Package Exports
- eve-sso-simple
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eve-sso-simple) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
eve-sso-simple
Simple promise-based node.js module simplifying EVE Online's SSO authentication flow. Please email me for bugs/suggestions!
Usage
var esso = require('eve-sso-simple');
router.get('/', (req, res) => {
esso.login(
{
client_id: 'registered app's client id',
client_secret: 'registered app's client secret',
redirect_uri: 'http://localhost:1337/login/callback',
scope: 'publicData characterFittingsRead characterFittingsWrite ...'
}, res);
});
router.get('/callback', (req, res) => {
// Returns a promise - resolves into a JSON object containing access and character token.
esso.getTokens({
client_id: 'registered app's client id',
client_secret: 'registered app's client secret'
}, req, res,
(accessToken, charToken) => {
res.send({access_token: accessToken, character_token: charToken})
}
);
});
Update
2.0.0 Separated the login (redirect) and callback (getting tokens) logic. Now uses callback to process the fetched access and character tokens instead of encoding and saving them directly as cookies.