2022-02-01 00:51:32 +01:00
|
|
|
import { IdentityTokenResponse } from "../models/response/identityTokenResponse";
|
|
|
|
|
2018-01-25 05:27:04 +01:00
|
|
|
export abstract class TokenService {
|
2021-12-16 13:36:21 +01:00
|
|
|
setTokens: (
|
|
|
|
accessToken: string,
|
|
|
|
refreshToken: string,
|
|
|
|
clientIdClientSecret: [string, string]
|
|
|
|
) => Promise<any>;
|
|
|
|
setToken: (token: string) => Promise<any>;
|
|
|
|
getToken: () => Promise<string>;
|
|
|
|
setRefreshToken: (refreshToken: string) => Promise<any>;
|
|
|
|
getRefreshToken: () => Promise<string>;
|
|
|
|
setClientId: (clientId: string) => Promise<any>;
|
|
|
|
getClientId: () => Promise<string>;
|
|
|
|
setClientSecret: (clientSecret: string) => Promise<any>;
|
|
|
|
getClientSecret: () => Promise<string>;
|
2022-02-01 00:51:32 +01:00
|
|
|
setTwoFactorToken: (tokenResponse: IdentityTokenResponse) => Promise<any>;
|
|
|
|
getTwoFactorToken: () => Promise<string>;
|
|
|
|
clearTwoFactorToken: () => Promise<any>;
|
2021-12-16 13:36:21 +01:00
|
|
|
clearToken: (userId?: string) => Promise<any>;
|
|
|
|
decodeToken: (token?: string) => any;
|
|
|
|
getTokenExpirationDate: () => Promise<Date>;
|
|
|
|
tokenSecondsRemaining: (offsetSeconds?: number) => Promise<number>;
|
|
|
|
tokenNeedsRefresh: (minutes?: number) => Promise<boolean>;
|
|
|
|
getUserId: () => Promise<string>;
|
|
|
|
getEmail: () => Promise<string>;
|
|
|
|
getEmailVerified: () => Promise<boolean>;
|
|
|
|
getName: () => Promise<string>;
|
|
|
|
getIssuer: () => Promise<string>;
|
|
|
|
getIsExternal: () => Promise<boolean>;
|
2018-01-09 22:19:55 +01:00
|
|
|
}
|