UNPKG

@alfresco/adf-core

Version:
97 lines (96 loc) 3.51 kB
import { AppConfigService } from '../../app-config/app-config.service'; import { Authentication } from '../interfaces/authentication.interface'; import { CookieService } from '../../common/services/cookie.service'; import { ContentAuth } from './content-auth'; import { ProcessAuth } from './process-auth'; import { Observable } from 'rxjs'; import { RedirectionModel } from '../models/redirection.model'; import { BaseAuthenticationService } from '../services/base-authentication.service'; import { HttpHeaders } from '@angular/common/http'; import * as i0 from "@angular/core"; export declare class BasicAlfrescoAuthService extends BaseAuthenticationService { private readonly contentAuth; private readonly processAuth; protected redirectUrl: RedirectionModel; authentications: Authentication; constructor(appConfig: AppConfigService, cookie: CookieService, contentAuth: ContentAuth, processAuth: ProcessAuth); /** * Logs the user in. * * @param username Username for the login * @param password Password for the login * @param rememberMe Stores the user's login details if true * @returns Object with auth type ("ECM", "BPM" or "ALL") and auth ticket */ login(username: string, password: string, rememberMe?: boolean): Observable<{ type: string; ticket: any; }>; /** * login Alfresco API * * @param username username to login * @param password password to login * @returns A promise that returns {new authentication ticket} if resolved and {error} if rejected. */ executeLogin(username: string, password: string): Promise<any>; private loginBPMECM; /** * Checks whether the "remember me" cookie was set or not. * * @returns True if set, false otherwise */ isRememberMeSet(): boolean; /** * Saves the "remember me" cookie as either a long-life cookie or a session cookie. * * @param rememberMe Enables a long-life cookie */ saveRememberMeCookie(rememberMe: boolean): void; isCredentialValid(credential: string): boolean; getToken(): string; isLoggedIn(): boolean; /** * logout Alfresco API * * @returns A promise that returns {logout} if resolved and {error} if rejected. */ logout(): Promise<any>; private logoutBPMECM; reset(): void; /** * Gets the URL to redirect to after login. * * @returns The redirect URL */ getRedirect(): string; setRedirect(url?: RedirectionModel): void; private hasValidRedirection; private hasSelectedProviderAll; /** * Gets the username of the authenticated user. * * @returns the username of the authenticated user */ getUsername(): string; /** * Does kerberos enabled? * * @returns True if enabled, false otherwise */ isKerberosEnabled(): boolean; getAuthHeaders(requestUrl: string, header: HttpHeaders): HttpHeaders; private addBasicAuth; requireAlfTicket(): Promise<void>; /** * Gets the BPM ticket from the Storage in Base 64 format. * * @param requestUrl the request url * @returns The ticket or `null` if none was found */ getTicketEcmBase64(requestUrl: string): string; private getProcessServicesTicket; private getContentServicesTicket; static ɵfac: i0.ɵɵFactoryDeclaration<BasicAlfrescoAuthService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<BasicAlfrescoAuthService>; }