import { HttpClient, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router'; import { AuthConfig, OAuthModuleConfig, OAuthResourceServerErrorHandler, OAuthService, OAuthStorage } from 'angular-oauth2-oidc'; import { Observable } from 'rxjs'; import { Environment } from '../core/public-api'; /** * This enum handles the selected backend */ export declare enum AuthBackend { /** * `sceiba` represent the Sceiba's backend */ sceiba = "sceiba", /** * `cuor` represent the Cuor's backend, The Organizations System */ cuor = "cuor" } /** * This service handles the behavior when a user authentications and * gives information about it. */ export declare class OauthAuthenticationService implements CanActivate, HttpInterceptor { private oauthStorage; protected http: HttpClient; private _router; private oauthService; private errorHandler; private moduleConfig; userInfoEndpoint: string; constructor(oauthStorage: OAuthStorage, http: HttpClient, _router: Router, oauthService: OAuthService, errorHandler: OAuthResourceServerErrorHandler, moduleConfig: OAuthModuleConfig); private authenticationSubject; /** * Observer to handles the behavior when a user authenticates */ authenticationSubjectObservable: Observable; /** * notifies by an observable if the user is authenticated * for the knowledge of who uses it * @param islogged 'true' is loggued or 'false' other way */ login(user: any): void; logout(): void; /** * gives information about an user authenticated */ getUserInfo(): Observable; canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean; intercept(req: HttpRequest, next: HttpHandler): Observable>; /** * Configure, this function is necessary if you will implement your own logic * @param authConfig: is the auth configuration. * you have to call `oauthService.initImplicitFlow()` in you login function * and `oauthService.logOut()` in you logout function */ configure(authConfig: AuthConfig): void; } export declare class SimpleAuthenticationService { private env; protected http: HttpClient; private _router; authBackend: AuthBackend; constructor(env: Environment, http: HttpClient, _router: Router); private authenticationSubject; /** * Observer to handles the behavior when a user authenticates */ authenticationSubjectObservable: Observable; /** * notifies by an observable if the user is authenticated * for the knowledge of who uses it * @param islogged 'true' is loggued or 'false' other way */ logguedChange(islogged: boolean): void; /** * gives information about an user authenticated */ getUserInfo(): Observable; }