UNPKG

@alfresco/adf-core

Version:
76 lines (75 loc) 2.97 kB
/*! * @license * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { HttpHeaders } from '@angular/common/http'; import { RedirectionModel } from '../models/redirection.model'; import { Observable, ReplaySubject } from 'rxjs'; import { AppConfigService } from '../../app-config/app-config.service'; import { CookieService } from '../../common/services/cookie.service'; import { AuthenticationServiceInterface } from '../interfaces/authentication-service.interface'; import ee from 'event-emitter'; export declare abstract class BaseAuthenticationService implements AuthenticationServiceInterface, ee.Emitter { protected appConfig: AppConfigService; protected cookie: CookieService; on: ee.EmitterMethod; off: ee.EmitterMethod; once: ee.EmitterMethod; emit: (type: string, ...args: any[]) => void; protected redirectUrl: RedirectionModel; onError: ReplaySubject<any>; onLogin: ReplaySubject<any>; onLogout: ReplaySubject<any>; protected constructor(appConfig: AppConfigService, cookie: CookieService); abstract getAuthHeaders(requestUrl: string, header: HttpHeaders): HttpHeaders; abstract getToken(): string; abstract isLoggedIn(): boolean; abstract logout(): any; abstract isEcmLoggedIn(): boolean; abstract isBpmLoggedIn(): boolean; abstract reset(): void; abstract getEcmUsername(): string; abstract getBpmUsername(): string; /** * Adds the auth token to an HTTP header using the 'bearer' scheme. * * @param requestUrl the request url * @param headersArg Header that will receive the token * @returns The new header with the token added */ addTokenToHeader(requestUrl: string, headersArg?: HttpHeaders): Observable<HttpHeaders>; isECMProvider(): boolean; /** * Does the provider support BPM? * * @returns True if supported, false otherwise */ isBPMProvider(): boolean; /** * Does the provider support both ECM and BPM? * * @returns True if both are supported, false otherwise */ isALLProvider(): boolean; isOauthConfiguration(): boolean; /** * Prints an error message in the console browser * * @param error Error message * @returns Object representing the error message */ handleError(error: any): Observable<any>; isOauth(): boolean; }