AuthProvider

Overview

This component wraps around all parts of the application that need authentication. It accepts a generic OIDC configuration suitable for any OIDC-compliant provider — Indigo IAM is the strategic SKAO direction; Entra ID is still supported.

Example : Indigo IAM
import { AuthProvider } from '@ska-telescope/ska-login-page';

...

<AuthProvider
   authority={AUTH_AUTHORITY}    /* e.g. https://iam-1.staging.devx.skao.int/ */
   clientId={AUTH_CLIENT_ID}
   redirectUri={AUTH_REDIRECT_URI}
>
     Code that requires authentication here
</AuthProvider>
Properties

Property

Usage

authority

OIDC issuer / discovery base URL. For Indigo: the IAM instance base URL. For Entra: https://login.microsoftonline.com/<tenant-id>/v2.0.

clientId

OAuth2 / OIDC client id registered with the provider.

redirectUri

Where the provider sends the user after successful authorization.

scope

Space-separated OIDC scopes. Defaults to openid profile email.

postLogoutRedirectUri

Optional URI to redirect to after logout.

When the authority host is not *.microsoftonline.com, the underlying MSAL instance is automatically configured with protocolMode: 'OIDC' and the host is added to knownAuthorities. No further configuration is required.

Note

The legacy MSENTRA_CLIENT_ID, MSENTRA_TENANT_ID, MSENTRA_AUTHORITY and MSENTRA_REDIRECT_URI props are still accepted as a deprecated shim for backwards compatibility. New code should use the generic props above.

Tip

  • Ensure that all redirect URI’s are registered with your provider, as they will vary between local and deployed instances.