TokenAPI Class
Constructor
TokenAPI
-
clientId
-
[options={}]
Parameters:
-
clientId
String- the OAuth client ID for the relier
-
[options={}]
Object optional- configuration
-
[clientSecret]
String optionalClient secret
-
[oauthHost]
String optionalFirefox Accounts OAuth Server host
Item Index
Methods
Methods
destroyToken
-
token OAuth
-
[options={}]
After a client is done using a token, the responsible thing to do is to destroy the token afterwards. See https://github.com/mozilla/fxa-oauth-server/blob/master/docs/api.md#post-v1destroy
Parameters:
-
token OAuth
Stringtoken to verify
-
[options={}]
Object optional- configuration
-
[xhr]
String optionalXMLHttpRequest compatible object to use to make the request.
Returns:
Response resolves to an empty object.
tradeCode
-
code OAuth
-
[options={}]
Trade an OAuth code for a longer lived OAuth token. See https://github.com/mozilla/fxa-oauth-server/blob/master/docs/api.md#post-v1token
Parameters:
-
code OAuth
Stringcode
-
[options={}]
Object optional- configuration
-
[xhr]
String optionalXMLHttpRequest compatible object to use to make the request.
Returns:
Response resolves to an object with access_token
, scope
, and
token_type
.
verifyToken
-
token OAuth
-
[options={}]
Verify an OAuth token is valid. See https://github.com/mozilla/fxa-oauth-server/blob/master/docs/api.md#post-v1verify
Parameters:
-
token OAuth
Stringtoken to verify
-
[options={}]
Object optional- configuration
-
[xhr]
String optionalXMLHttpRequest compatible object to use to make the request.
Returns:
Response resolves to an object with user
, client_id
, and
scopes
.