Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
bluemix-helper-sso
Advanced tools
Bluemix Helper for adding oAuth SSO support to your application
bluemix-helper-sso is a nodejs module library that makes it very easy to add authentication to your Bluemix application using the IBM Single Sign-On service. You can find more information on SSO Service here.
Note: Before using this library, please make sure that your application is written in nodejs and is using expressjs and passportjs framework.
Please follow the following steps to add and configure an SSO service to work with your Bluemix application:
https://<your_app_route>/auth/sso/callback
where <your_app_route> is the bluemix route used by your application e.g. https://myapp.mybluemix.net/auth/sso/callback
This SSO Service configuration step is now complete. The next section will cover how to add authentication to the application code.
As mentioned before, expressjs and passportjs framework are expected to be used in your node application.
You can check out the sample app in the /example directory.
The following example code shows demonstrates how the steps needed to easily add authentication to your Bluemix application:
var express = require('express'); //expressjs
var bluemixHelperConfig = require('bluemix-helper-config'); //helper config to locate sso service
var bluemixHelperSSO = require('bluemix-helper-sso'); //Helper SSO
...
var app = express();
//Locate the sso service by using regular expression (The name doesn't have to match exactly)
var ssoService = bluemixHelperConfig.vcapServices.getService( "sso" );
if ( ssoService) {
//Add SSO authentication to the app
bluemixHelperSSO(app, {
ssoService:ssoService,
relaxedUrls:[
"/js", "/img", "/css", "/bower_components", "templates"
]
});
}
...
Note: when running locally, you will need to tell the bluemix-helper-sso about the host and port, so it can properly compute the callback url. This is done using the global object of bluemix-helper-config module as follow:
...
var global = bluemixHelperConfig.global;
...
var port = process.env.VCAP_APP_PORT || 8082;
if (!process.env.VCAP_APP_HOST){
//Need to set the host and port for this app as we are running locally
global.appHost = "http://127.0.0.1";
global.appPort = port;
}
By default, bluemix-helper-sso is using an in-memory session store to manage to the session ids. Optionally, you can also configure it to use your own session store, by passing a configuration object in the sessionConfig field. The following code example shows how to use redis as the session store:
...
var ssoService = bluemixHelperConfig.vcapServices.getService( "pipes-sso" );
if ( ssoService ){
//Add SSO authentication to the app
bluemixHelperSSO(app, {
ssoService: ssoService,
relaxedUrls:[
"/js", "/img", "/css", "/bower_components", "templates"
],
createSessionStore: function( session ){
//Use redis service to create the store if available
var redisService = bluemixHelperConfig.vcapServices.getService("pipes-redis");
if ( redisService ){
var redisStore = require('connect-redis')(session);
return new redisStore({
host: redisService.credentials.hostname,
port: redisService.credentials.port,
pass: redisService.credentials.password
});
}
return null;
}
});
}
...
FAQs
Bluemix Helper for adding oAuth SSO support to your application
The npm package bluemix-helper-sso receives a total of 0 weekly downloads. As such, bluemix-helper-sso popularity was classified as not popular.
We found that bluemix-helper-sso demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.