@nospamproxy/core
    Preparing search index...

    Manages the authentication part of an app.

    For more information refer {@page security | the README}.

    interface IAuthenticationService {
        canChallenge: boolean;
        canSwitchTenant: boolean;
        challenge(): Promise<Readonly<User>>;
        getAppCategories(): NspAppCategories | null;
        getCurrentUser(tenantName?: string | null): Promise<Readonly<User>>;
        getTenants(
            __namedParameters?: Partial<TenantFilterOptions>,
        ): Promise<TenantInfo>;
        handleNonOkResponse(response: Response, url?: string | URL): Promise<never>;
        redirectToLogin(providers: string[]): void;
        renewToken(): Promise<void>;
        setAppLoadingFinished(): void;
        signOut(callSignOutEp?: boolean): Promise<void>;
        switchTenant(tenantName: string): Promise<boolean>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    canChallenge: boolean
    canSwitchTenant: boolean

    Methods

    • Returns the current user if set, otherwise fetches the user info from user-info endpoint (whoami). If the whoami endpoint also returns service endpoints information (in case of cloud), it also configures the ConfigurationManager with the endpoints. The tenantName will be ignored if the user is already logged in. This is done to avoid the potential hazard of attempting to change the tenant by calling this method.

      Parameters

      • tenantName: string | null = null

      Returns Promise<Readonly<User>>

    • Internal

      Parameters

      • response: Response
      • Optionalurl: string | URL

      Returns Promise<never>

    • Internal

      Parameters

      • providers: string[]

      Returns void

    • Signs out the current user, and redirects to login page.

      Parameters

      • OptionalcallSignOutEp: boolean = true

        Set this to false, to only redirect to login page.

      Returns Promise<void>

    • Parameters

      • tenantName: string

      Returns Promise<boolean>