import { AuthService } from './AuthService'; import { IccAuthApi } from '../../icc-api'; import { JwtBridgedAuthService } from './JwtBridgedAuthService'; import { BasicAuthService } from './BasicAuthService'; import { JwtAuthService } from './JwtAuthService'; import { UserGroup } from '../../icc-api/model/UserGroup'; /** * @internal you should not implement this interface yourself. */ export interface AuthenticationProvider { /** * @internal this method is meant for internal use only and may be changed without notice */ getAuthService(): AuthService; /** * @internal this method is meant for internal use only and may be changed without notice * Gives a new authentication provider for the same user and authentication method but for a different iCure group * @param newGroupId id of the new group to switch to * @param matches the list of groups the user is in, containing also the group-specific id of the user. Note that users with same login username but * different password are considered as if they are different users and should not appear in these matches. You can get this list by calling * {@link IccUserApi.getMatchingUsers} authenticated. * @return a new authentication provider */ switchGroup(newGroupId: string, matches: Array): Promise; getIcureTokens(): Promise<{ token: string; refreshToken: string; } | undefined>; } export declare class EnsembleAuthenticationProvider implements AuthenticationProvider { private readonly authApi; private readonly username; private readonly password; private readonly jwtTimeout; private readonly basicAuth; private jwtAuth; private suspensionEnd; constructor(authApi: IccAuthApi, username: string, password: string, jwtTimeout?: number, jwtAuth?: JwtAuthService | JwtBridgedAuthService, basicAuth?: BasicAuthService, thirdPartyTokens?: { [thirdParty: string]: string; }); getIcureTokens(): Promise<{ token: string; refreshToken: string; } | undefined>; getAuthService(): AuthService; switchGroup(newGroupId: string, matches: Array): Promise; } export declare class JwtAuthenticationProvider implements AuthenticationProvider { private readonly authApi; private readonly username?; private readonly password?; getIcureTokens(): Promise<{ token: string; refreshToken: string; } | undefined>; private readonly jwtAuth; /** * @internal * @param authApi * @param username * @param password * @param jwtAuth * @param icureToken */ constructor(authApi: IccAuthApi, username?: string | undefined, password?: string | undefined, jwtAuth?: JwtAuthService | JwtBridgedAuthService, icureToken?: { token: string; refreshToken: string; }); getAuthService(): AuthService; switchGroup(newGroupId: string, matches: Array): Promise; } export declare class BasicAuthenticationProvider implements AuthenticationProvider { private username; private password; getIcureTokens(): Promise<{ token: string; refreshToken: string; } | undefined>; constructor(username: string, password: string); getAuthService(): AuthService; switchGroup(newGroupId: string, matches: Array): Promise; } export declare class NoAuthenticationProvider implements AuthenticationProvider { getAuthService(): AuthService; getIcureTokens(): Promise<{ token: string; refreshToken: string; } | undefined>; switchGroup(newGroupId: string, matches: Array): Promise; }