-
Notifications
You must be signed in to change notification settings - Fork 3
10. Authentication and Authorization Service
Ali Badakhshan edited this page Apr 15, 2019
·
3 revisions
Narik Authentication Service helps you to do everything related to Authentication.
export abstract class AuthenticationService {
/**
* Current user value of authentication service
*/
readonly currentUserValue: ApplicationUser;
/**
* Current user of authentication service
*
* An `Observable` that emit whenever currentUser changed.
*/
readonly currentUser: Observable<ApplicationUser>;
/**
* Logins authentication service
* @param loginmodel Information needed for login
* @returns login
*/
abstract login(loginmodel: LoginModel): Promise<LoginResult>;
/**
* Logouts authentication service
* @returns logout
*/
abstract logout(): Promise<boolean>;
/**
* Refreshs authentication service
* @returns refresh
*/
abstract refresh(): Promise<ApplicationUser>;
}
Currently Narik created NarikJwtAuthentication. a Authentication Service based on JWT. This service is in narik-jwt-authentication. To use it you should import it on your module.
NarikJwtAuthenticationModule.forRoot({
loginEndPoint: "api/account/Authenticate",
logoutEndPoint: "api/account/Logout",
refreshEndPoint: "api/account/Authenticate",
tokenStorage: "localStorage",
loginPageUrl: "/"
})
If you want, You can extend AuthenticationService and use your own AuthenticationService.
Narik Authorization Service is under development.
- Getting started
- Documentation
- Architecture & Services
- UI Framework