Class: OauthAuthMethods

Defined in: src/methods/oauth-auth-methods.coffee

Overview

Provides methods to interact with the auth store.

Instance Method Summary

Constructor Details

# (void) constructor(models)

Initializes a new instance of the @see AuthMethods class.

Parameters:

  • models (Object) A collection of models to be used within the auth framework.

Instance Method Details

# (void) currentDateAndSeconds(seconds = TENYEARSINSECONDS) Bound

Returns the current date + seconds

Parameters:

  • seconds (Number) The seconds, or if null then roughly 10 years is assumed.

# (void) appForClientId(clientId, options = {}, cb = function() {}) Bound

Retrieves an app for a key. This ONLY retrieves active keys

Parameters:

  • appKey (string) the application key to retrieve the app for.

# (void) validate(token, clientId, options = {}, cb = function() {}) Bound

Somehow validates a token. A valid token exists, has not been revoked yet, has an expiration higher than now. isClientValid can be checked for tighter security.

# (void) createAccessGrant(accountId, appId, userId, redirectUrl, scope, realm = null, options = {}, cb = function() {}) Bound

Creates a new access grant.

Parameters:

  • appId (String || ObjectId) the mongoose app id.
  • userId (String || ObjectId) the mongoose user id
  • redirectUrl (String) the requested redirect_uri. This must be later matched when issuing an access token.
  • scope (String[]) an array of strings, with one or more elements, specifying the scope that should be granted.
  • realm (String) an optional realm for which this access grant is for.
  • cb (Callback) the callback that will be invoked, with err and the mongoose AccessGrant model.

# (void) createOrReuseTokenForUserId(accountId, userId, clientId, realm, scope, expiresIn, options = {}, cb = function() {}) Bound

Creates a token for a user/app/realm

# (void) createTokenForUserId(accountId, userId, clientId, realm = null, scope = null, expiresIn = null, options = {}, cb = function() {}) Bound

Creates a token for a user/app/realm

# (void) exchangeAuthorizationCodeForAccessToken(code, options = {}, cb = function() {}) Bound

Takes a code and exchanges it for an access token

Parameters:

  • code (String) the authorization_code to exchange into an access token

# (void) exchangeRefreshTokenForAccessToken(refreshToken, options = {}, cb = function() {}) Bound

Takes a code and exchanges it for an access token

Parameters:

  • refreshToken (String) the refresh_token to exchange into an access token

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: