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!

Problems with multiple Social Sign-In and Google

FlammiferApr 12 2023

Hello,

I have managed to include Apple sign-in, Google through oauth, and there is also application authentication scheme.

Apple seems to work fine, for both login and logout, and doesn't require its authentication scheme to be set as Current.

For Google, there are multiple articles but none addresses the logout. The app signout with &LOGOUT_URL. won't work for google, as the user will just stay signed in. So I have referred to:

https://developers.google.com/identity/sign-in/web/sign-in

Included file URL: https://apis.google.com/js/platform.js?onload=onLoad

Under global function declaration:

function signOut() {
var auth2 = gapi.auth2.getAuthInstance();
auth2.signOut().then(function () {
auth2.disconnect();
});

}

Under HTML Header:

<meta name="google-signin-client_id" content="MY_CLIENT_ID_HERE.apps.googleusercontent.com">

And signout link for testing purposes:

<a href="#" onclick="signOut();">Sign out</a>

However I am getting error with it:

Uncaught TypeError: Cannot read properties of undefined (reading 'getAuthInstance')
at signOut (home?session=653589597206:203:32)
at HTMLAnchorElement.onclick (home?session=653589597206:108:186)

And only once I got logout, but out of whole workspace instead of app.

Is there a more straightforward way of doing it in APEX?

Second issue is - Google auth won't work if its not set as Current authentication scheme, even if sending request on separate login page, for example 9999 instead of 101, like: https://domain.net/apex/f?p=122:9999:0:APEX_AUTHENTICATION=GOOGLE:::::.

The /apex/apex_authentication.callback page will then stay blank.

I have Switch in session property enabled for each scheme.

It would be best to have custom application authentication scheme set as default, and have Google activated on Google Sign-In button. As I said, Apple seems to work regardless if current or not.

Any input would be helpful. Thanks.

Comments
Post Details
Added on Apr 12 2023
0 comments
478 views