Authentication-pkg
General
This package implements authentication for web and native (>= iOS 10, >= Android 4.0.3 & UWP 10), included SSO with Microsoft Authenticator.
This package uses authentication from adal-angular and adal-cordova
Install
npm install authentication-adal-pkg
Usage
import { authentication } from 'authentication-adal-pkg';
API
authentication
Methods
initialize(config): void
Config is an object that should contain following properties:
- tenant***
- clientId***
- redirectUriWeb*
- redirectUriAndroid (and/or) redirectUriIos** (and/or) redirectUriWindows**
- authority**
- resourceUri**
- loginPolicy
- editProfilePolicy
- changePasswordPolicy
- userId**
- loginResource
*required for authentication web
**required for authentication native
***required for authentication web & native
signIn() Promise<{token, error}>
signOut(): Promise<{}>
acquireToken(): Promise<token>
getTokenFromCache(): token
getUser(): Promise<{family_name, given_name, name, upn}>
getUserFromCache(): {family_name, given_name, name, upn}