/** * Copyright 2022 Agendize 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 { AxiosInstance } from 'axios'; import { ApiErrors } from '../data/Error'; import { AccountEntity } from '../data/Account'; import { IndexedDb } from '../db'; import { Logger } from "../utils/logger"; import { UserEntity } from "../data/User"; import { LoginProviderDto } from "../data/LoginProvider"; import { LoginRealmDto } from "../data/LoginRealm"; export default interface TokenDto { access_token: string; refresh_token: string; expire_in: Number; token_type: string; } export declare class AuthenticationService { private logger?; protected readonly instance: AxiosInstance; protected readonly indexedDb: IndexedDb; protected readonly baseURL: string; protected readonly clientId: string; private axiosLoggerBuilder; constructor(indexedDb: IndexedDb, baseURL: string, clientId: string, logger?: Logger); private buildAuthorizeUrl; loginWithRedirect(callbackUrl: string, locale?: string, error?: ApiErrors, autoRedirect?: boolean, scope?: string): string; getAccessTokenFromBasic(authorizationCode: string, login: string, password: string): Promise; getAccessToken(authorizationCode: string): Promise; getAccessTokenWithGrant(authorizationCode: string, grantType: 'authorization_code' | 'password', params?: any): Promise; resetPassword(redirect: string, username: string): Promise; getLoginRealm(redirect: string, realm?: string): Promise; getLoginProviders(redirect: string): Promise; private getNotNullItem; refreshOrganisationStorage(selectedOrganisation: AccountEntity): Promise; refreshUserStorage(allUsers: UserEntity[] | undefined, meInOrganisation: UserEntity): Promise; clearAfterAccountSwitch(): Promise; logout(): Promise; refreshToken(): Promise; private _initializeResponseInterceptor; private _handleResponse; private _handleError; }