Skip to main content
Version: Next

AuthHandler

Home > @backstage/plugin-auth-backend > AuthHandler

Warning: This API is now obsolete.

Use createOAuthRouteHandlers from @backstage/plugin-auth-node instead

The AuthHandler function is called every time the user authenticates using the provider.

The handler should return a profile that represents the session for the user in the frontend.

Throwing an error in the function will cause the authentication to fail, making it possible to use this function as a way to limit access to a certain group of users.

Signature:

export type AuthHandler<TAuthResult> = (input: TAuthResult, context: _AuthResolverContext) => Promise<AuthHandlerResult>;

References: _AuthResolverContext, AuthHandlerResult