adobe/passport-adobe-oauth2

Name: passport-adobe-oauth2

Owner: Adobe Systems Incorporated

Description: Passport strategy for authenticating users with an AdobeId using OAuth2.

Created: 2018-01-17 01:03:23.0

Updated: 2018-04-18 20:54:19.0

Pushed: 2018-04-18 21:05:38.0

Homepage:

Size: 36

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Passport-Adobe-OAuth2

Passport strategy for authenticating users with an AdobeId using the OAuth 2.0 API.

This module lets you authenticate using Adobe Identity Management Services (IMS) in your Node.js applications. By plugging into Passport, AdobeId authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.

Adobe Authentication - Getting Started

Install
$ npm install passport-adobe-oauth2
Usage
Create an integration on Adobe Console

You need to set up OAuth web credentials for Creative SDK to use the sample.

Configure Strategy

The Adobe authentication strategy authenticates users using an Adobe ID 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 client ID, client secret, and callback URL.

// You should modify the following values to match your own application
var ADOBE_STRATEGY_CONFIG = {
    clientID: "Insert Adobe Client ID Here",
    clientSecret: "Insert Adobe Client Secret Here",
    callbackURL: "https://www.example.net:3000/auth/adobe/callback"
};

// Use the AdobeStrategy within Passport.
// Strategies in Passport require a `verify` function, which accepts credentials
// (in this case, an accessToken, refreshToken, and Adobe profile)
// and invoke a callback with a user object.
passport.use(new AdobeStrategy(ADOBE_STRATEGY_CONFIG,
    function (accessToken, refreshToken, profile, done) {
        //verify function below
        // asynchronous verification, for effect...
        process.nextTick(function () {
            // To keep the example simple, the user's Adobe profile is returned to
            // represent the logged-in user.  In a typical application, you would want
            // to associate the Adobe account with a user record in your database,
            // and return that user instead.
            // var  userId = profile.userId || profile.sub;
            return done(null, profile);
        });
    }
));
Authenticate Requests

Use passport.authenticate(), specifying the 'adobe' strategy, to authenticate requests.

For example, as route middleware in an Express application:

app.get('/auth/adobe/login.html',
  passport.authenticate('adobe'));

app.get('/auth/adobe/callback',
  passport.authenticate('adobe', { failureRedirect: '/login' }),
  function(req, res) {
    // Successful authentication, redirect home.
    res.redirect('/');
  });
Tests
$ npm test
Credits
License

Apache License, Version 2.0

Copyright (c) 2014 - present Adobe Systems Incorporated. All rights reserved.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.