import { AnyObject, ClassType, IdType, ValueOrPromise } from '../../../common'; import { RequestContext } from '@loopback/rest'; import { UserProfile } from '@loopback/security'; export interface IJWTTokenPayload extends UserProfile { userId: IdType; roles: { id: IdType; identifier: string; priority: number; }[]; clientId?: string; provider?: string; } export interface ITokenPayload extends IJWTTokenPayload { } export type TGetTokenExpiresFn = () => ValueOrPromise; export interface IAuthenticateTokenOptions { tokenSecret: string; tokenExpiresIn: number; refreshExpiresIn: number; refreshSecret: string; } export interface IAuthenticateRestOptions { restPath?: string; serviceKey?: string; requireAuthenticatedSignUp?: boolean; signInRequest?: ClassType; signUpRequest?: ClassType; changePasswordRequest?: ClassType; } export interface IAuthenticateOAuth2RestOptions { restPath?: string; tokenPath?: string; authorizePath?: string; oauth2ServiceKey?: string; useImplicitGrant?: boolean; } export interface IAuthenticateOAuth2Options { enable: boolean; handler: { type: 'authorization_code'; authServiceKey: string; }; restOptions?: IAuthenticateOAuth2RestOptions; viewFolder?: string; } export declare class SignInRequest { identifier: { scheme: string; value: string; }; credential: { scheme: string; value: string; }; clientId?: string; } export declare class ChangePasswordRequest { oldCredential: { scheme: string; value: string; }; newCredential: { scheme: string; value: string; }; userId: IdType; } export declare class SignUpRequest { username: string; credential: string; [additional: string | symbol]: any; } export declare class OAuth2PathRequest { clientId: string; clientSecret: string; redirectUrl: string; } export declare class OAuth2AuthorizationCodeRequest { clientId: string; clientSecret: string; authorizationCode: string; redirectUrl: string; grantType: string; } export interface IAuthService { signIn(opts: SIRQ & { requestContext?: RequestContext; }): Promise; signUp(opts: SURQ & { requestContext?: RequestContext; }): Promise; changePassword(opts: CPRQ & { requestContext?: RequestContext; }): Promise; getUserInformation?(opts: UIRQ & { requestContext?: RequestContext; }): Promise; } //# sourceMappingURL=types.d.ts.map