nativescript-azure-auth1.0.4 • Public • Published
Add your plugin badges here. See nativescript-urlhandler for example.
Then describe what's the purpose of your plugin.
Current version: 1.0.3
tns plugin add nativescript-azure-auth
Usage - Angular
Create a authentication service that uses this library.
The login and logout can be consumed in a component.
The best use-case for getToken would be in an interceptor so you can be sure that the latest access token is attached to your header when you make a http request to a protected Rest API.
public login(clearCache?: boolean): Promise<string>
Opens a webview that redirects to login.microsoft.com.
clearCache parameter clears the ADAL tokenCache when set to true. By default clearCache is set to true.
public getToken(): Promise<string>
Silently retrieves a token from Azure Active Directory using the refresh token being stored by the respective native libraries for ADAL. Best used with an interceptor or when creating http request that require th token.
public clearCache(): void
Clears the entire token cache for the clientId set when instantiating this library.
Thanks to James Browning for providing help.
Apache License Version 2.0, January 2004