1.0.3 • Published 5 years ago

@logiscool/passport-scoolcode v1.0.3

Weekly downloads
-
License
UNLICENSED
Repository
bitbucket
Last release
5 years ago

Scoolcode OAuth Strategy

Usage

You can install the strategy using NPM or Yarn:

$ npm install @logiscool/passport-scoolcode

To use you have to initialise it:

const ScoolcodeStrategy = require('@logiscool/passport-scoolcode').Strategy;
passport.use(new ScoolcodeStrategy({
        clientID: '...',
        clientSecret: '...',
        callbackURL: 'https://.../auth/sc/callback',
        requestCRMToken: false
    },
    (accessToken, profile, callback) => {
        console.log(accessToken.scoolcode); // Scoolcode token
        console.log(accessToken.crm); // CRM token (if requested)
        console.log(profile); // Scoolcode account
        
        if(profile.kind.developer) 
            callback(null, profile)
        else
            callback(new Error('Forbidden: only for developers'))
    }
));
1.0.3

5 years ago

1.0.2

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago