NbAuthService
Common authentication service. Should be used to as an interlayer between UI Components and Auth Strategy.
Methods
Name | Description |
authenticate() | parameters: strategyName: returns:string , data: any Observable<NbAuthResult> Authenticates with the selected strategy
Stores received token in the token storage |
getStrategy() | parameters: strategyName: returns:string NbAuthStrategy Get registered strategy by name |
getToken() | returns: Observable<NbAuthToken> Retrieves current authenticated token stored |
isAuthenticated() | returns: Observable<boolean> Returns true if auth token is present in the token storage |
isAuthenticatedOrRefresh() | returns: Observable<boolean> Returns true if valid auth token is present in the token storage.
If not, calls the strategy refreshToken, and returns isAuthenticated() if success, false otherwise |
logout() | parameters: strategyName: returns:string Observable<NbAuthResult> Sign outs with the selected strategy
Removes token from the token storage |
onAuthenticationChange() | returns: Observable<boolean> Returns authentication status stream |
onTokenChange() | returns: Observable<NbAuthToken> Returns tokens stream |
refreshToken() | parameters: strategyName: returns:string , data: any Observable<NbAuthResult> Sends a refresh token request
Stores received token in the token storage |
register() | parameters: strategyName: returns:string , data: any Observable<NbAuthResult> Registers with the selected strategy
Stores received token in the token storage |
requestPassword() | parameters: strategyName: returns:string , data: any Observable<NbAuthResult> Sends forgot password request to the selected strategy |
resetPassword() | parameters: strategyName: returns:string , data: any Observable<NbAuthResult> Tries to reset password with the selected strategy |
Need some help or found an issue?
Ask on Stack Overflow with tag `nebular` or post an issue on GitHub.