/*! * @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 { AlfrescoApiClient } from '../alfrescoApiClient'; import { AlfrescoApiConfig } from '../alfrescoApiConfig'; import { Authentication } from './authentication'; import { AlfrescoApi } from '../alfrescoApi'; import { HttpClient } from '../api-clients/http-client.interface'; import { PathMatcher } from '../utils/path-matcher'; interface Userinfo { name: string; given_name?: string; family_name?: string; preferred_username?: string; email?: string; picture?: string; } export declare class Oauth2Auth extends AlfrescoApiClient { static readonly DEFAULT_AUTHORIZATION_URL = "/protocol/openid-connect/auth"; static readonly DEFAULT_TOKEN_URL = "/protocol/openid-connect/token"; static readonly DEFAULT_USER_INFO_ENDPOINT = "/protocol/openid-connect/userinfo"; static readonly DEFAULT_LOGOUT_URL = "/protocol/openid-connect/logout"; private refreshTokenIntervalPolling; private refreshTokenTimeoutIframe; private checkAccessToken; hashFragmentParams: any; token: string; discovery: { loginUrl?: string; logoutUrl?: string; tokenEndpoint?: string; userinfoEndpoint?: string; }; authentications: Authentication; iFrameHashListener: any; pathMatcher: PathMatcher; constructor(config: AlfrescoApiConfig, alfrescoApi: AlfrescoApi, httpClient?: HttpClient); setConfig(config: AlfrescoApiConfig, alfrescoApi: AlfrescoApi): void; initOauth(): void; discoveryUrls(): void; getProfile(): Promise; hasContentProvider(): boolean; checkFragment(nonceKey?: string, externalHash?: any): any; private refreshBrowserLogin; private useFragmentTimeLogin; isPublicUrl(): boolean; padBase64(base64data: any): any; processJWTToken(jwt: any, nonceKey: string): any; b64DecodeUnicode(b64string: string): string; storeIdToken(idToken: string, exp: number): void; storeAccessToken(accessToken: string, expiresIn: number, refreshToken?: string): void; saveUsername(username: string): void; implicitLogin(): void; isValidToken(): boolean; isValidAccessToken(): boolean; getIdToken(): string; getAccessToken(): string; redirectLogin(): void; isRedirectionUrl(): boolean; genNonce(): string; composeImplicitLoginUrl(): string; composeIframeLoginUrl(): string; hasHashCharacter(hash: string): boolean; startWithHashRoute(hash: string): boolean; getHashFragmentParams(externalHash: string): string; parseQueryString(queryString: string): any; silentRefresh(): void; removeHashFromSilentIframe(): void; createIframe(): void; destroyIframe(): void; /** * login Alfresco API * @returns A promise that returns {new authentication token} if resolved and {error} if rejected. */ login(username: string, password: string): Promise; grantPasswordLogin(username: string, password: string, resolve: any, reject: any): import("../alfrescoApiClient").AlfrescoApiClientPromise; pollingRefreshToken(): void; /** * Refresh the Token * @returns promise of void */ refreshToken(): Promise; universalBtoa(stringToConvert: string): any; /** * Set the current Token */ setToken(token: string, refreshToken: string): void; /** * Get the current Token * @returns token value */ getToken(): string; /** * return the Authentication * @returns authentications */ getAuthentication(): Authentication; /** * Change the Host */ changeHost(host: string): void; /** * If the client is logged in return true * @returns is logged in */ isLoggedIn(): boolean; /** * Logout */ logOut(): Promise; invalidateSession(): void; exchangeTicketListener(alfrescoApi: AlfrescoApi): void; } export {};