Setting Up Authentication

Configure your project’s authentication backend, sign-in methods, email delivery, password policies, and multi-factor authentication in the Oracle Backend with Supabase APIs Console.

Prerequisites

Enabling Authentication for a Project

To configure authentication for a project, follow these steps:

  1. Open the Console and select your project.

  2. Select Authentication.

  3. Select Set up authentication.

    Figure 10-1 Authentication Setup

    Description of the illustration figure-10-1-authentication-setup.png

Basic Authentication Setup

Use BASIC authentication to test email and password sign-in. You can also configure supported social sign-in providers for production applications. For supported sign-in methods, see Basic Authentication.

To configure BASIC authentication, follow these steps:

  1. Open Authentication.

  2. Select Set up authentication.

  3. Select Basic.

  4. Select Save.

You can also configure these optional settings:

LDAP Authentication Setup

Use LDAP authentication when your organization already manages users in LDAP and wants centralized user storage. Oracle Backend with Supabase APIs does not install LDAP for you. It connects to your LDAP server during setup.

To configure LDAP authentication, follow these steps:

  1. Open Authentication.

  2. Select Set up authentication.

  3. Select Advanced, and then LDAP.

  4. Enter the LDAP connection details:

    • Auth hostname: LDAP_HOST

    • Auth port number: LDAP_PORT

    • LDAP directory DN: LDAP_USER_DIR

    • LDAP Directory Admin Username and LDAP Directory Admin Password.

  5. Select Save.

    Figure 10-2 LDAP Authentication Configuration

    Description of the illustration figure-10-2-ldap-authentication-configuration.png

You can also configure password policies and SMTP for email verification and password reset.

IDCS Authentication Setup

IDCS lets you use an OCI IAM Domain as the authentication server for your Oracle Backend with Supabase APIs project.

To integrate IDCS, you need the following:

Prerequisite

Use an Oracle IAM identity domain edition that includes end-user self-registration. The Free edition does not include this feature, which Oracle Backend with Supabase APIs uses when provisioning the project’s self-registration profile for IDCS authentication.

To obtain an access token, follow these steps:

  1. In your identity domain, create a confidential application with the Client Credentials grant type and the Identity Domain Administrator app role. For instructions, see Adding a Confidential Application.

  2. Request an access token using the application’s client ID and client secret. For instructions, see Access Token.

Oracle Backend with Supabase APIs uses this token once, during setup, to configure the target domain on your behalf.

See Get Started with Oracle Identity Cloud Service for more information about setting up IDCS.

Warning:

To configure IDCS authentication, follow these steps:

  1. In the Console, select Authentication, and then Set up authentication.

  2. Select Advanced, and then IDCS.

  3. Enter the domain URL and access token.

  4. Select Save.

    Figure 10-3 IDCS Authentication Configuration

    Description of the illustration figure-10-3-idcs-authentication-configuration.png

After Save

Your Oracle Identity Domain acts as the identity provider for this project. End users authenticate against IDCS, and the Oracle Backend with Supabase APIs SDK consumes the tokens IDCS issues.

For the SDK calls that initiate authentication, see Authentication SDK Reference.

External IDCS Authentication Setup

External IDCS lets a project integrate with an enterprise Oracle IAM identity domain. It uses the same API calls as IDCS authentication and supports organizations with multiple users and IDCS applications.

To configure External IDCS, follow these steps:

  1. In the Console, select your project and open Authentication.

  2. Select Set up authentication, and then select Enterprise.

    External IDCS Configuration

    Description of the illustration authentication-external-idcs-configuration.png

  3. Enter the Domain URL and administrator Access token for the enterprise IAM identity domain. See IDCS Authentication Setup for token-acquisition instructions.

  4. Select Save.

External IDCS limits project administration to users and groups associated with the project:

For External IDCS authentication, manage groups and data roles in the Oracle IAM identity domain. The database maps the IAM groups to data roles and applies their associated data grants.

After a successful sign-in, service requests use the External IDCS end-user access token directly instead of exchanging it for a native service token. The DeepSec infrastructure uses this token to map IAM end users to data roles and data grants.

Setting Up Third-Party Identity Providers

Application users can sign in with social accounts such as Google, Facebook, and GitHub. BASIC and LDAP support these OAuth 2.0 sign-in methods. You can also configure a supported OIDC or SAML identity provider, such as Auth0 or Okta.

Set up Social Sign-in (GitHub, Google, and more)

  1. In Google Cloud Console, open APIs & Services and then Credentials.

  2. Select Create credentials, and then create an OAuth client ID.

  3. Set Application type to Web application, and enter an app name.

  4. Add the Oracle Backend with Supabase APIs OAuth redirect URI to the Authorized redirect URIs list.

  5. Save the client and copy the Client ID and Client Secret.

  6. In the Oracle Backend with Supabase APIs Console, enable Google, and enter the client ID and client secret.

On the Facebook for Developers site, obtain the app ID and app secret for your app. Use these values as the client ID and client secret in the Console.

To enable Facebook sign-in, follow these steps:

  1. In the Console, open Authentication > Social login.

  2. Enable Facebook and enter the client ID and client secret from Facebook.

  3. In your Facebook app’s settings on the Facebook for Developers site, add the Console’s OAuth redirect URI to the allowed redirect URIs for Facebook Login.

To enable GitHub sign-in, follow these steps:

  1. Register your app as a developer application on GitHub and get your app’s OAuth 2.0 Client ID and Client Secret.

  2. In the Console, open Authentication > Social login.

  3. Enable GitHub and enter the client ID and client secret from GitHub.

  4. In your GitHub app’s settings, set Authorization callback URL to the OAuth redirect URI shown in the Console.

Configuring OIDC and SAML Identity Providers

Oracle Backend with Supabase APIs supports sign-in through OpenID Connect (OIDC) and Security Assertion Markup Language (SAML) identity providers. Enter the provider’s configuration in the Console, then register the callback URI with the provider. Keep both consoles available during setup.

Configure an OpenID Connect (OIDC) Provider

Before configuring a supported OIDC provider, obtain the following information:

Set Up in the Console

  1. In the Oracle Backend with Supabase APIs Console, open your project and select Authentication.

  2. In Social login, select Add new provider > OpenID Connect. The Configure OIDC dialog opens.

    OIDC Provider Configuration

    Description of the illustration authentication-oidc-configuration.png

  3. Turn on Enable to make the fields editable.

  4. Enter Name, OIDC Discovery URL, App ID, and App secret.

  5. Select Save.

Register the Redirect URI with Your Identity Provider

  1. In the provider’s configuration dialog, select Copy URI to copy the OAuth redirect URI.

  2. In your identity provider’s application settings, add that URI to the list of allowed redirect URIs.

Complete both configurations before signing users in.

Configure a SAML 2.0 Provider

To sign in users using a SAML identity provider, you must first collect the following information from the provider:

To configure the SAML provider in the Console, follow these steps:

  1. In the Oracle Backend with Supabase APIs Console, open your project and select Authentication.

  2. In Social login, select Add new provider > SAML. The Configure SAML dialog opens.

    SAML Provider Configuration

    Description of the illustration authentication-saml-configuration.png

  3. Turn on Enable to make the fields editable.

  4. Enter Name, Entity ID, SSO URL, and Certificate.

  5. Select Save.

For application return-origin configuration, see Authorized Domains.

Configure the Callback and Audience in Your Identity Provider

In your SAML identity provider’s application settings, configure the following:

Use the provider from your app:

After saving, the Console lists the provider with an ID of the form oidc_<name> or saml_<name>. For example, a SAML provider named example appears as saml_example. Pass that exact string to your SDK’s federated sign-in API.

Use the initialized relational client from Initialize the JavaScript SDK. To sign in with a popup, call client.auth.signInWithOAuth():

const { error } = await client.auth.signInWithOAuth({
  provider: "oidc_example",
  options: { skipBrowserRedirect: true }
});
if (error) throw error;

For SAML, set provider to the Console’s saml_* provider ID. To use a full-page redirect, omit options.skipBrowserRedirect. Handle the return with client.auth.getRedirectResult(), as shown in Web Sign-In Flow.

Configuring SMTP for Email Verification and Password Reset

Use email verification to confirm a user’s email address and password reset to help users recover their accounts. These emails contain a one-time code for the operation.

IDCS uses its own email service. You can customize these emails in the identity domain’s console.

For BASIC and LDAP, configure an SMTP server to send email. Obtain the following configuration values:

Parameter Description
smtp_host SMTP Server Host
smtp_port SMTP Server Port
smtp_auth_username Username for signing in to the SMTP server
smtp_auth_passkey Password for signing in to the SMTP server
default_from The sender of the email
connection_type SSL / TLS
wallet_path Wallet path for the secure connection and SSL certificates

Console Steps

To configure SMTP, follow these steps:

  1. In the Console, select Project settings > SMTP settings.

    Figure 10-4 SMTP Settings

    Description of the illustration figure-10-4-smtp-settings.png

  2. Select Manage SMTP settings.

  3. Enter the SMTP server details, authentication credentials, and sender email address. Select the connection type and provide the wallet path if required by your configuration.

  4. Select Save.

Defining Password Policies

Password policies apply to BASIC and LDAP users and are enforced during sign-up and password reset.

Use a password policy to align with your organization’s security requirements.

Configurable Attributes:

Password policies support the following requirements:

Console Steps

To configure a password policy, follow these steps:

  1. In the Console, select Authentication > Password policy.

  2. Select Manage policy.

    Figure 10-5 Password Policy Settings

    Description of the illustration figure-10-5-password-policy-settings.png

  3. In Edit password policy, set the character requirements and minimum and maximum lengths.

  4. Select Save.

Setting Up Multi-Factor Authentication

Multi-factor authentication (MFA) adds a verification step after primary authentication. Enrolled users verify a code before receiving authentication tokens.

MFA supports these factors:

With BASIC authentication, ORDS BaaS manages factor enrollment, and Twilio or Vonage delivers SMS messages. With IDCS authentication, the connected identity domain manages factors and SMS delivery.

Before you configure MFA:

To configure MFA for BASIC authentication, follow these steps:

  1. Open the project’s Authentication area and its multi-factor settings.
  2. Open Authenticator App, enable it, and save the configuration to allow TOTP enrollment. TOTP does not require SMS provider credentials.
  3. To allow SMS enrollment, open SMS, select a provider, and enter its required configuration:

    Provider Required configuration
    Twilio Account SID, Auth Token, and Verify Service SID
    Vonage API key, API secret, and SMS sender name or number
  4. Enable SMS, save the configuration, and confirm delivery to the intended destinations.

Enabling a factor makes it available for enrollment. Users must complete enrollment and verify a code before the factor can protect their sign-ins.

To configure MFA for IDCS authentication, follow these steps:

  1. Complete IDCS Authentication Setup for the project using its domain URL and an administrator access token.
  2. In the project’s multi-factor settings, enable MFA enrollment policy, and save the configuration. ORDS configures the sign-on policy for the existing IDCS domain application and initially selects TOTP and SMS.
  3. Adjust the Authenticator App and SMS selections as needed. IDCS handles SMS delivery.

The IDCS MFA policy works as follows:

Changing Authentication Providers

You can switch the authentication provider for a project. This affects all apps in the project.

Switching between BASIC or LDAP and IDCS does not migrate user accounts. Users must register again with the selected provider. Account links associated with the previous provider no longer work.

Before switching, plan for users to register again and configure SMTP if the selected provider requires it.

Switching Authentication Providers

Use a project owner account to change authentication configuration. To switch providers, follow these steps:

  1. Sign in to the Oracle Backend with Supabase APIs Console.

  2. Select your project.

  3. Open Authentication > Authentication setup.

  4. Select Manage configuration.

  5. Select the provider:

    • Basic: No external setup required.

    • LDAP: Requires the LDAP host, port, administrator DN, password, and user directory.

    • IDCS: Requires a domain URL and an administrator access token. See IDCS Authentication Setup.

    • External IDCS: Uses the Enterprise setup choice. See External IDCS Authentication Setup.

  6. Enter the configuration details:

Setting Up and Managing Authentication Using CLI

Prerequisite

Configure the Oracle Backend with Supabase APIs command-line interface (CLI) before using these commands.

See Also: Configure the CLI for detailed steps on how to set up the CLI for Oracle Backend with Supabase APIs

Initialize the Administrative Session

Before configuring authentication, sign in to the CLI and select the project. If the CLI has no initialized session, use:

fusabase init

Enter the ORDS OAuth client credentials when prompted, and select the project. The CLI obtains an administrative access token using the client credentials grant. This is separate from signing an application user in through the SDK.

For a configured CLI session, you can renew the administrative token with:

fusabase login CLIENT_ID:CLIENT_SECRET

Replace CLIENT_ID and CLIENT_SECRET with the ORDS OAuth client credentials configured for the CLI. Prefer the interactive init prompts when entering credentials so they do not appear in shell history.

Set Authentication

Configure authentication for the selected project:

fusabase set-auth --path=AUTH_CONFIG_PATH

Replace AUTH_CONFIG_PATH with the path to the authentication configuration JSON file.

Note: Administrative tokens expire. Renew the CLI session when needed.

Authentication Management