new Auth()
Azure AD V2 Auth API
Methods
(async, static) acquireTokenSilent(parameters)
Try to obtain token silently without user interaction
- Source:
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object
|
|
(async, static) clearPersistenCache(userId)
Clear persystent cache - AsyncStorage - for given client ID and user ID or ALL users
- Source:
Parameters:
Name | Type | Default | Description |
---|---|---|---|
userId |
String
|
null |
ID of user whose tokens will be cleared/deleted if ommited - tokens for ALL users and current client will be cleared |
(static) exchange(input) → {Promise}
Exchanges a code obtained via /authorize
for the access tokens
- Source:
- See:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
input |
Object
|
input used to obtain tokens from a code
|
Returns:
- Type:
-
Promise
(static) loginUrl(parameters) → {String}
Builds the full authorize endpoint url in the Authorization Server (AS) with given parameters.
- Source:
- See:
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object
|
parameters to send to
|
Returns:
- Type:
-
String
authorize url with specified parameters to redirect to for AuthZ/AuthN.
(static) logoutUrl() → {String}
Builds the full logout endpoint url in the Authorization Server (AS) with given parameters. https://login.microsoftonline.com/common/oauth2/logout?post_logout_redirect_uri=[URI]&redirect_uri=[URI]
- Source:
Returns:
- Type:
-
String
logout url with default parameter
(static) msGraphRequest(parameters) → {Promise}
Return user information using an access token
- Source:
- See:
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object
|
user info parameters
|
Returns:
- Type:
-
Promise
(static) refreshTokens(parameters) → {Promise}
Obtain new tokens (access and id) using the Refresh Token obtained during Auth (requesting offline_access
scope)
- Source:
- See:
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object
|
refresh token parameters
|
Returns:
- Type:
-
Promise