Single Sign-On (SSO) support for Eve Online
This module provides a simple interface to Eve Online's Single Sign-On oAuth process. Requested access tokens can then be used to authenticate an Eve character or to access the RESTful CREST API.
Install
npm install eve-singlesignon --save
Set up
In order to use Single Sign-On feature, you first need to create a new application in the developer section.
This will give you the required client ID and secret. You will need to give the redirect (or callback) URL, the URL where the client will be redirected to after logging in (this is the /sso_callback in the example below).
Resources
- Authentication Flow (in
getAccessToken(code)
) - Obtaining a Character ID (in
verifyAccessToken()
) - Refresh Tokens (
getAccessToken()
with a refresh token)
Example with Express
This is an incomplete and minimalistic example of how to use the most basic functionality. Refer to the source code for further inline documentation.
;; const app = ; // Here you can provide the required parametersconst CLIENT_ID = 'client_id';const SECRET_KEY = 'secret_key';const CALLBACK_URL = 'http://example.com/sso_callback'; // Create a new instance with the set parametersconst sso = CLIENT_ID SECRET_KEY CALLBACK_URL; // Refer the client to the Eve Online SSO login screen on loginapp; // This is the callback that is called when the client has logged inapp
Changelog
- v0.0.5 - 28 August 2016
- Update readme
- v0.0.4 - 28 May 2016
- Move the
simple
request option to_request
- Move the
- v0.0.2/v0.0.3 - 26 May 2016
- (0.0.3) Added getters for most constructor parameters and setter for server URI
- (0.0.2) Fixed getting an access token from a refresh token
- v0.0.1 - 25 May 2016
- Initial release
License
Copyright 2016 Michiel van der Velde.
This software is licensed under the MIT License