import { IObserver } from '../observer/IObserver'; import { ITokenManager } from './Interfaces/ITokenManager'; import { KeycloakLogin } from '../models/keycloak-login'; export default class TokenManager extends ITokenManager { private readonly url; private accessToken?; private refreshToken?; private accessTokenExpireTime?; private refreshTokenExpireTime?; private clientId?; private clientSecret?; private username?; private password?; private refreshIntervalId?; private requestOfflineAccess; private isRefreshing; private hasWarnedShortTokens; constructor(url: string, observers?: IObserver[]); initializeManager: (keycloakLogin: KeycloakLogin) => Promise; protected makeRefreshRequest: (apiConfig: { url: any; method?: string; headers?: Record; body: any; }) => Promise; protected refreshAccessToken: () => Promise; /** * Re-authenticate using the password grant type when refresh token expires */ protected reauthenticateWithPassword: () => Promise; /** * Schedule token refresh based on the expiration times returned by Keycloak */ protected scheduleTokenRefresh: () => void; protected notify: () => void; }