ContextDeferredAuthProvider
Home > @gooddata/sdk-backend-tiger > ContextDeferredAuthProvider
ContextDeferredAuthProvider class
This implementation of authentication provider defers the responsibility for performing authentication to the context in which it exists.
Signature:
export declare class ContextDeferredAuthProvider extends TigerAuthProviderBase
Extends: TigerAuthProviderBase
Remarks
In other words it expects that the application will take care of driving the authentication and creating a correct session in which the Tiger backend can make authenticated calls.
This is a go-to authentication provider for UI applications. The entire flow is as follows:
The application that uses backend configured with this provider must expect that some of the backend calls with result in NotAuthenticated exception.
The exception will contain
loginUrl
set to the URL on the current origin - this is location of the login page.The application must redirect the entire window to this URL appended with
redirectTo
query parameter.The value of this parameter is the application's URL that will be used as a return location.
The login page will start and drive the OIDC authentication flow. Once the flow finishes and session is set up, the login page will redirect back to the application.
You may use the provider's ability to use passed NotAuthenticatedHandler
function. This will be called every time a NotAuthenticated error is raised by the backend. Your application can pass a custom handler of this event - typically something that will start driving the authentication from a single place.
Note: the not authenticated handler MAY be called many times in succession so you may want to wrap it in a call guard or in a debounce.
See redirectToTigerAuthentication() for implementation of the NotAuthenticated handler which you may use with this provider.
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(notAuthenticatedHandler) | Constructs a new instance of the ContextDeferredAuthProvider class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
onNotAuthenticated | (context: IAuthenticationContext, error: NotAuthenticated) => void |
Methods
Method | Modifiers | Description |
---|---|---|
authenticate(context) |