This module lets you authenticate against an instance of Dedicated Bluemix (via CloudFoundry's UAA server) in your Node.js applications. By plugging into Passport, Dedicated Bluemix authentication can integrated into any application or framework that supports Connect-style middleware, including Express.
$ npm install passport-dedicated-bluemix
Register Application with Bluemix's User Account and Authentication Service
passport-dedicated-bluemix, you must register the application with your Dedicated Bluemix User Account and Authentication Service (UAA). If you have not already done so, client application registration can be found in here. As a side note, you will have to have some elevated permissions in your Bluemix instance to be able to register a client application with it's UAA server. Remember the
client_secret to use with the passport strategy. In addition, the
redirect_uri will have to match the route in your application.
The Dedicated Bluemix authentication strategy authenticates users using a CloudFoundry UAA user account and OAuth 2.0 tokens. The strategy requires a
verify callback, which accepts these credentials and calls
done providing a user, as well as
options specifying a a user info URL, authorization URL, token URL, client ID, client secret, and callback URL.
passport.authenticate(), specifying the
'dedicated-bluemix' strategy, to authenticate requests.
For example, as route middleware in an Express application:
How do I request additional permissions?
If you need additional permissions from the user, the permissions can be
requested via the
scope option to
How can I retain some sort of data throughout the OAuth flow?
CloudFoundry's UAA server utilizes a state parameter that will be passed back to the
/callback route of your application. If you need to use this, the permissions can be
requested via the
state option to