Need Help? We are right here!
Thanks for your inquiry.
If you dont hear from us within 24 hours, please feel free to send a follow up email to info@xecurify.com
Search Results:
×NodeJS SSO (Single Sign-On) allows your users to log into NodeJS with your Identity Provider credentials. IT admins can easily manage user access activities and grant or revoke SSO access to NodeJS application. This is done using JSON Web Token (JWT) tokens and it can be easily integrated with NodeJS built in any framework or language.
In case you need our help with the integration or setup proces, feel free to reach out using this link.
miniOrange provides user authentication from various external sources, which can be Directories (like ADFS, Microsoft Active Directory, Azure AD, OpenLDAP, Google, AWS Cognito etc), Identity Providers (like Shibboleth, Ping, Okta, OneLogin, KeyCloak), Databases (like MySQL, Maria DB, PostgreSQL) and many more.
We are using ADFS to show the setup.
You can directly move to Step 3 if you have already configured an IDP.
IDP Name | Enter Your IDP Name |
IDP Entity ID | http://<YOUR_ADFS_DOMAIN>/adfs/services/trust |
SAML SSO Login URL | http://<YOUR_ADFS_DOMAIN>/adfs/ls/ |
X.509 Certificate | Provide the ADFS signing certificate |
A. Service Provider Entity ID / Issuer: https://login.xecurify.com/moas
B. Assertion Consumption Service (ACS) URL: Find SAML ACS URL option in added Identity Source.
C. Download Metadata: This is required if you want to Download metadata. Download metadata to avoid putting the values manually.
D. Signing Certificate (Optional): This is required if you want to enable signed SAML Auth request so that IdP can verify that the contents have not been altered in transit. Download the signing certificate with the steps below.
E. Configure miniOrange as a relying party in ADFS:
https://login.xecurify.com/moas/login/broker/login/saml/acs/{YOUR_CUSTOMER_KEY}
in the Relying Party URL textbox and click Next the button.https://login.xecurify.com/moas/login
A. Add Node JS app in miniOrange:
In miniOrange dashboard, you can add JWT application with steps below:
https://login.xecurify.com/moas/jwt/mobile
B. Add SSO link in Node JS:
https://login.xecurify.com/moas/broker/login/jwt/<customer-id>?client_id=<client-id>&redirect_uri=<redirect-url>
customer-id | Customer ID of your miniOrange account which can be found under settings menu.Refer image below. |
client-id | Client Id of JWT application created above(Step 3.a). |
redirect-url | Configured Redirect URL against JWT application. |
const fs = require("fs");
const MoJWT = require("mo-jwt-connector");
//This URL can be copied from JWT app in miniOrange dashboard
const miniOrangeSSOURL =
"https://jsdemo.xecurify.com/moas/broker/login/jwt/258267?client_id=lXN6XGc1yoh8M6Gd&redirect_uri=http://localhost:3000/auth/callback";
// start authentication request
app.get("/auth", (req, res, next) => {
res.redirect(miniOrangeSSOURL);
});
// authentication callback
app.get("/auth/callback", (req, res, next) => {
var id_token = req.query.id_token;
// var cert = fs.readFileSync("cert.crt");
var jwtBuilder = new MoJWT.JWTBuilder();
console.log("Parts " + id_token.split(".").length);
jwtBuilder.parseJwt(id_token); // initialize the token using parseJwt
jwtBuilder.setSecret(fs.readFileSync("./path/to/RSA256Cert.crt",'utf8')); // Set the certificate downloaded from miniOrange dashboard
var verified = jwtBuilder.verifyJwt(); // Verify the signed token
if (!verified) res.send("Error Occurred while verifying JWT Token");
var payload = jwtBuilder.getPayload(); // If the token is valid, use getPayload to read the data from the token.
var firstname = payload.first_name;
var lastname = payload.last_name;
var email = payload.email;
res.send(
"Email : " + email +
"
Firstname : " +
firstname +
"
Lastname: " +
lastname
);
});
C. Verify JWT token and parse user details for SSO:
eg. xxxx.yyyyyyyyyyyy.zzzzzz
D. Perform SSO:
This is an optional step. If you want to ensure that all sessions (SP and IDP) for a user are properly closed, you can configure Single Logout with the steps below.
A. Configure miniOrange with IdP SLO endpoint:
B. Configure IdP with miniOrange SLO endpoint:
https://login.xecurify.in/moas/broker/login/saml_logout/<your-customer-id>
C. Configure your JWT application with SLO endpoint:
https://login.xecurify.in/moas/broker/login/jwt/logout/<your-customer-id>?redirect_uri=<redirect-url>
your-customer-id | You have to add your miniOragne account customer ID here. |
redirect-url | This should be replaced with the logout URL of your JWT application. |
Our Other Identity & Access Management Products