Backstage
    Preparing search index...

    Provides token authentication and credentials management.

    See the service documentation for more details.

    interface AuthService {
        authenticate(
            token: string,
            options?: { allowLimitedAccess?: boolean },
        ): Promise<BackstageCredentials<unknown>>;
        getLimitedUserToken(
            credentials: BackstageCredentials<BackstageUserPrincipal>,
        ): Promise<{ expiresAt: Date; token: string }>;
        getNoneCredentials(): Promise<BackstageCredentials<BackstageNonePrincipal>>;
        getOwnServiceCredentials(): Promise<
            BackstageCredentials<BackstageServicePrincipal>,
        >;
        getPluginRequestToken(
            options: { onBehalfOf: BackstageCredentials; targetPluginId: string },
        ): Promise<{ token: string }>;
        isPrincipal<TType extends keyof BackstagePrincipalTypes>(
            credentials: BackstageCredentials,
            type: TType,
        ): credentials is BackstageCredentials<BackstagePrincipalTypes[TType]>;
        listPublicServiceKeys(): Promise<{ keys: JsonObject[] }>;
    }
    Index

    Methods

    • Verifies a token and returns the associated credentials.

      Parameters

      • token: string
      • Optionaloptions: { allowLimitedAccess?: boolean }
        • OptionalallowLimitedAccess?: boolean

          If set to true, allow limited access tokens (such as cookies).

          If this flag is not set, or is set to false, calls with limited access tokens will lead to a @backstage/errors#NotAllowedError being thrown.

      Returns Promise<BackstageCredentials<unknown>>