Introduction
SAML (Security Assertion Markup Language) Sign-In Authentication in Oracle APEX
enables secure, standards-based single sign-on (SSO) by allowing users to
authenticate through an external identity provider (IdP). With SAML, users can
log in once through their corporate identity system and access multiple
applications without needing to re-enter credentials. This integration enhances
security, simplifies user access, and ensures centralized control over identity
management in enterprise environments.
SAML (Security Assertion Markup Language) Sign-In Authentication in Oracle APEX allows users to authenticate through a trusted external Identity Provider (IdP), such as Microsoft Entra ID (formerly Azure AD), Okta, or any other SAML 2.0-compliant provider. This method supports enterprise-level single sign-on (SSO), enabling users to sign in once and gain access to multiple systems without repeatedly entering credentials.
To configure SAML authentication in Oracle APEX, begin by setting up the Identity Provider (IdP). The IdP must be configured to recognize your Oracle APEX application as a Service Provider (SP). During this step, you will generate and exchange metadata between the IdP and APEX. The metadata includes the entity ID, assertion consumer service (ACS) URL, and public signing certificate.
In APEX, go to Shared Components > Authentication Schemes, then click Create and choose Based on a Preconfigured Scheme from Gallery. Select Social Sign-In. Although it’s labeled for social providers, APEX 21.2 and higher support SAML through this method. Provide a name like “SAML Enterprise Login.”
Configure the authentication scheme with the following details:
- Authentication Provider: Choose SAML 2.0.
- Identity Provider Metadata URL or upload the XML metadata file provided by your IdP.
- SP Entity ID: This uniquely identifies your APEX application as a service provider.
- ACS URL: This is the URL where the IdP will post the SAML response. APEX provides this value automatically, usually in the form https://<your-domain>/ords/wwv_flow.accept.
After setting these parameters, APEX will automatically register its public key and certificate if needed. Ensure your web server is accessible using HTTPS, as SAML requires secure transport for the assertion data.
In the authentication scheme, you can define how to extract the username from the SAML response. Most IdPs send it in the NameID field, but you can also use custom attributes such as email, username, or UPN. Use the Username Attribute Mapping field in APEX to define how this data is read.
Example:
NameID
or
user.email
Set this new SAML authentication scheme as the current one for your application. Once active, when users attempt to access your app, they will be redirected to the IdP login page. After successful authentication, the IdP sends a signed SAML assertion back to APEX, and the session is established.
You can use the Post-Authentication Procedure to run custom PL/SQL logic once the user has been authenticated. This is useful for assigning roles, initializing session variables, or logging activity.
Example:
BEGIN
SELECT role INTO :APP_ROLE FROM app_users WHERE username = :APP_USER;
END;
Be sure to test the flow end to end. Use the IdP’s diagnostic tools and logs if authentication fails, and confirm that the APEX app correctly receives the SAML assertion.
SAML authentication in Oracle APEX provides robust security, eliminates password fatigue, and improves user experience by enabling federated identity management. It is a powerful option for organizations that require centralized access control and seamless single sign-on integration with their enterprise infrastructure.
SAML (Security Assertion Markup Language) Sign-In allows delegated authentication to an external SAML identity provider (IdP). This enables single sign-on (SSO), allowing users to authenticate once and gain access to multiple applications without repeated logins.
Key Features of SAML Authentication
- Single Sign-On (SSO) – Users log in once and can access multiple systems without re-entering credentials.
- Secure Identity Federation – Enables authentication via a trusted identity provider (IdP).
- Standardized Protocol – Uses an XML-based framework for secure authentication across different platforms.
- Improved User Experience – Reduces password fatigue and enhances security by minimizing multiple logins.
Prerequisites for Using SAML Sign-In
Oracle Database Version – SAML authentication requires:
- Oracle Database 19c (Database Release Update 19.9.0.0.0 or later)
- Oracle Database 23ai
If your database does not meet these requirements, the SAML Sign-In authentication scheme will not be available.
Configured SAML Identity Provider (IdP) – Your organization must have a SAML-compliant IdP, such as:
- Oracle Identity Cloud Service (IDCS)
- Microsoft Entra ID (formerly Azure AD)
- Okta
- Google Workspace
- Any other IdP supporting SAML 2.0
Service Provider (SP) Configuration – Oracle APEX must be registered as a service provider with the IdP to enable authentication.
How SAML Sign-In Works in Oracle APEX
- User Requests Access – The user attempts to access an Oracle APEX application.
- Redirect to IdP – The application redirects the user to the configured SAML identity provider (IdP).
- User Authentication – The user logs in with corporate credentials at the IdP.
- Assertion Exchange – The IdP generates a SAML assertion (a secure token containing user identity details) and sends it back to APEX.
- Session Establishment – APEX validates the assertion and establishes an authenticated session for the user.
- Application Access – The user is granted access and can navigate the application without further authentication.
Benefits of Using SAML Sign-In in Oracle APEX
- Stronger Security – Centralized authentication helps enforce multi-factor authentication (MFA) and security policies.
- Seamless User Experience – Users do not need to remember multiple passwords for different applications.
- Enterprise Integration – Easily connects to corporate identity management systems for user authentication.
- Regulatory Compliance – Meets security standards like GDPR, HIPAA, and SOC 2 by using a federated authentication approach.
Modern Authentication Recommendation
Oracle recommends SAML or OAuth2/OIDC authentication over traditional database or APEX account authentication for production environments. SAML provides strong security, seamless access management, and integration with enterprise identity providers, making it a preferred choice for cloud and enterprise applications.
To set up a SAML Sign In authentication scheme in your application:
- On the Workspace home page, click the App Builder icon.
- Select an application.
- On the Application home page, click Shared Components.
The Shared Components page appears.
1. Under Security, select Authentication Schemes.
2. On the Authentication Schemes page, click Create.
3. Select Based on a pre-configured scheme from the gallery and click Next.
4. Under Name:
a. Name - Enter the name used to reference the authentication scheme by other application developers.
b. Scheme Type - Select SAML Sign In.
4. Under Settings:
- Use SAML Attributes of - Select Instance.
- Convert Username To Upper Case - Configure whether the attribute values for the username should be converted to upper case.
Click Create Authentication Scheme.
Conclusion
Implementing SAML Sign-In Authentication in Oracle APEX provides a powerful and
flexible solution for organizations looking to streamline access across
multiple systems. By connecting APEX with a trusted identity provider,
developers can offer a secure and seamless user experience while reducing
administrative overhead. SAML authentication strengthens access control,
supports enterprise SSO strategies, and aligns APEX applications with modern
security standards.