AWS Cognito is a popular cloud-based user authentication and management service provided by Amazon Web Services (AWS). It provides a simple and secure way for developers to manage user identities and access control for their applications. In this blog, we'll look at how to use AWS Cognito to authenticate an Oracle APEX application using Single Sign-On (SSO). This will allow users to log in to the Oracle APEX application using their existing AWS credentials, making the authentication process smoother and more secure. Whether you're a developer looking to implement SSO in your Oracle APEX application or simply interested in learning more about AWS Cognito, this blog is for you.
Before getting started with the APEX side of things, there are a few prerequisites.
You must have an AWS account and have set up Cognito:
This will show you how to:
Once you have successfully set up and configured Cognito, APEX requires the following information for the integration. It is worth saving this information somewhere handy at this point:
We need to add the client ID as a web credential at the workspace level to utilise it in our app(s).
Now we need to create an authentication scheme for our application.
Leave everything else as default for now and select Apply Changes.
Now that the authentication scheme is set up, we need to handle the logout of the application. To do this, we must create a new (blank) page.
PX_AWS_CLIENT_ID
PX_AWS_ENV
PX_AWS_REDIRECT_URL
PX_AWS_CLIENT_ID: Cognito Client ID.
PX_AWS_ENV: Domain name from Cognito e.g: https://installer-connect-staging.auth.eu-west-2.amazoncognito.com.
PX_AWS_REDIRECT_URL: This should be the home page URL of your application.
begin
apex_session.delete_session (
p_session_id => :APP_SESSION);
end;
Finally, we need to set our Post Logout URL.
In conclusion, it is great that we can integrate SSO authentication seamlessly into our APEX applications, giving our users a modern, seamless and secure authentication experience. AWS Cognito is very popular and is relatively simple to set up and implement in your application, allowing you to focus on application development while Cognito handles the heavy lifting of authentication and access control. For more information on Cognito and its capabilities, check out the developer guide.
If this blog was of interest, be sure to take a look at our AWS and Oracle Application Development services. If you would like to speak to one of our Oracle APEX experts, get in touch through enquiries@dsp.co.uk.