StormpathOAuth
stormpath.oauth
A service for managing the OAuth client-side authentication flow logic. It
offers methods for authenticating via the password grant type, refreshing
access tokens via refresh tokens, and revoking the current token.
Attempts to authenticate the user, using the password grant flow by default,
although the method can be overriden via the requestOpts parameter. If
successful, automatically stores the token using
StormpathOAuthToken.setTokenResponse.
| Param | Type | Details |
|---|---|---|
| requestData | Object | Authentication data object. Expects an email/username and a password field. |
| opts (optional) | Object | Additional request options, (e.g. headers), optional. |
| Promise | A promise containing the authentication response |
Attempts to refresh the current token, using its refresh token. If successful, updates the currently stored token using StormpathOAuthToken.setTokenResponse with the response data.
| Param | Type | Details |
|---|---|---|
| requestData (optional) | Object | Additional data to add to the refresh POST request, optional. |
| opts (optional) | Object | Additional request options, (e.g. headers), optional. |
| Promise | A promise containing the refresh attempt response |
Attempts to revoke the currently active token. If successful, also removes
the token from storage, using
StormpathOAuthToken.removeToken.
This method is specific to an OAuth workflow, $auth.endSession() should be used instead
as it is generc and defers to this method when nedeed.
| Promise | A promise containing the revokation response |