Passport strategy for Oracle's IDCS which authenticates a user and manages that user's session.
Based on work done by Indrajil Jha. This module draws heavily on his, but is designed to be a little more self-contained, and have simplified configuration.
$ npm install idcs-passport-authentication-strategy
This strategy is designed to plug into PassportJS to enable authentication against Oracle IDCS using its OAuth endpoints. It extends the default passport-oauth strategy, though due to some idiosyncratic behaviour in the underlying oauth package, implements its own authentication approach.
In addition to authentication, the strategy exports a logout helper method to invalidate tokens in IDCS.
Sample usage is as follows (example shown for express):
var passport = ;var session = ;var IDCSStrategy = ;var express = ;var app = ;var passportConfig = ;passport;passport;passport;app;app;app;//Login URLapp;//Callback URLapp;//Rest of endpoints etc...
Check the passportjs documentation for more details.
Using this module requires a Web Application to be configured in IDCS to support the Authorization Code and Refresh Token grants (to obtain access tokens, and allow passport to manage the token exchange). It requires client access to the 'Me' Identity Cloud Service Admin APIs (to obtain the user profile).
A typical configuration object looks like the following:
post_logout_redirect is only used for logout (see below), and is not required for authentication.
The strategy also exposes a method which assembles the logout URL, to invalidate the tokens in IDCS. This simply assembles the URL defined here. It may simply be my IDCS instance, but it seems that this endpoint differs from the documentation slightly, and this function will likely change in future. If you have issues, I would advise assembling this URL yourself based upon the linked documentation.