Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Post authentication procedure - check user

Tom vd DuinSep 21 2023

Hi all,

We have an existing APEX app and I'm currently adding the possibility to login to the app using Google. I've created a new Authentication scheme with type ‘Social Sign-in’ with Authentication Provider: Google. That all works fine; the user is now redirected to the Google login page, logs in there and is redirected back to APEX and is also logged in in the app. I set the username to #email# in the authentication scheme, so the :APP_USER is set to the email address of the user.

However; I want to be able to reject or invalidate the login, if the email address of the logged in user, is not known in the user table of the app. I tried to accomplish that with a post-authentication procedure, but didn't succeed.

What I tried:

  • Raise an error: that results in a ‘Error in PLSQL code raised during plug-in processing. Contact your application administrator.’ notification
  • call to apex_error.add_error: that isn't shown and the user is loggedin in the application
  • call to apex_authentication.logout, with session_id and app_id parameters. I get an error: Internal Error Contact your application administrator.
  • call to apex_authentication.logout, without parameters: I now get the notification: Session expired
  • call to apex_custom_auth.logout: also the Session expired notification.

Ideally, when a user is authenticated with Google and the user is not known in the user table of the app, I want to redirect to user to a (public) page where a friendly message is shown.

I'm using APEX 22.2.4 on Oracle 19. Can someone point me in the right direction?

Regards,

Tom

Comments
Post Details
Added on Sep 21 2023
2 comments
1,282 views