UNPKG

1.93 kBTypeScriptView Raw
1import { HttpException } from '@nestjs/common';
2import { Configuration, Context, IUser } from '..';
3import { CredentialRepository, LoginCredentials } from './auth.repository';
4import { UserService } from './user.service';
5import { AuthCallbacks } from "./auth.callbacks";
6export declare class AuthenticationFailedException extends HttpException {
7 constructor(message: string);
8}
9export declare function hashPassword(password: string): Promise<string>;
10export declare class AuthService {
11 private readonly authRepository;
12 private readonly userService;
13 private readonly configurationProvider;
14 private readonly authCallbacks;
15 private readonly logger;
16 constructor(authRepository: CredentialRepository, userService: UserService<IUser>, configurationProvider: Configuration, authCallbacks: AuthCallbacks);
17 validateUser(context: Context, username: string, password: string): Promise<IUser>;
18 validateFakeLogin(context: Context, secret: string | string[] | undefined, email: string, name: string, roles: string[], orgId: string, props: any): Promise<IUser>;
19 validateUserGoogle(context: Context, inputProfile: object): Promise<IUser>;
20 validateUserSaml(context: Context, profile: SimpleUserProfile): Promise<IUser>;
21 validateUserOidc(context: Context, profile: any, overwriteCredentials: boolean): Promise<IUser>;
22 private buildUserRoles;
23 private buildUserProperties;
24 validateUserAuth0(context: Context, email: string, name: string, orgId: string, roles: string[], props: any): Promise<IUser>;
25 createAccount(context: Context, email: string, password: string, account: string): Promise<LoginCredentials>;
26 private validateOrCreateExternalAuthAccount;
27 private loadUserAndCheckEnabled;
28 private validateUserEnabled;
29 private getAccountByEmail;
30 private toName;
31}
32export interface SimpleUserProfile {
33 email: string;
34 firstName?: string;
35 lastName?: string;
36}