Search This Blog

Tuesday, July 15, 2025

HOW DO I Establish User Identity with Authentication

Introduction
Authentication in Oracle APEX is the process of verifying the identity of a user before granting access to an application. Establishing user identity allows developers to secure their apps, track user activity, and provide role-based access to data and features. Oracle APEX offers flexible authentication options—from built-in login to enterprise-grade integrations like LDAP and Single Sign-On. Understanding how to set up and manage authentication is essential for building secure, professional applications.

How to Establish User Identity with Authentication in Oracle APEX

  1. Access the Authentication Schemes

    • Open your application in APEX.

    • Go to Shared Components.

    • Under Security, click on Authentication Schemes.

    • You will see a list of schemes, with one set as "Current."

  2. Choose an Authentication Scheme
    APEX supports several authentication methods:

    • APEX Accounts (for development and testing)

    • Database Accounts

    • LDAP Directory

    • Social Sign-In (Google, Facebook, etc.)

    • Custom Authentication

    • Oracle Single Sign-On (SSO)

    To add or change a scheme:

    • Click Create.

    • Select the desired method (e.g., LDAP Directory).

    • Configure the required settings such as host, port, and base DN.

    • Click Make Current to activate the scheme.

  3. Test Authentication Setup

    • Run your application.

    • You should be redirected to a login page.

    • Enter valid credentials based on your selected scheme.

    • Once logged in, APEX sets APP_USER to the authenticated username.

  4. Create Custom Authentication Logic (Optional)
    For advanced use cases, you can create a custom authentication scheme:

    • Choose Custom as the scheme type.

    • Provide PL/SQL code that validates username and password from a custom user table.

    • Example:

      DECLARE
        l_valid BOOLEAN;
      BEGIN
        SELECT 1 INTO l_valid FROM app_users
        WHERE username = :USERNAME
        AND password = :PASSWORD;
        RETURN TRUE;
      EXCEPTION
        WHEN NO_DATA_FOUND THEN
          RETURN FALSE;
      END;

Best Practices

  • Use LDAP or SSO for enterprise applications to leverage existing identity systems.

  • Keep passwords hashed when using custom authentication.

  • Use SSL/TLS to protect login credentials during transmission.

  • Clearly label your login page and error messages to improve user experience.

  • Set Authorization Schemes after authentication to control what users can access based on identity.

Oracle APEX Documentation

For full details on authentication in APEX, refer to the official documentation:
https://docs.oracle.com/en/database/oracle/apex/23.2/aeapp/authentication.html

Conclusion
Establishing user identity through authentication is a foundational security step in Oracle APEX development. Whether using built-in APEX accounts for testing or integrating with enterprise SSO solutions, the platform provides flexible and powerful options. With proper authentication in place, you can protect data, personalize the user experience, and build secure, role-based applications with confidence.

No comments:

Post a Comment

Learning ORACLE APEX: How to Add a Delete Button to a Classic Report

  Link: https://youtu.be/7zd-HDzicdY How to Add a Delete Button to a Classic Report When Using a Single Select List, a Button to Add to Tabl...