OHDSI Home | Forums | Wiki | Github

Atlas/WebAPI Google Oauth Integration Error

Hi OHDSI Community! Struggling to implement Google OAuth in Atlas/WebAPI

Error details shows: Request details: redirect_uri=http://localhost/WebAPI/user/oauth/callback?client_name=Google2Client

I’ve placed http://localhost/WebAPI/user/oauth/callbackin my google console client credentials redirect URIs:

Wondering if it has something to do with the ?client_name=Google2Client appended to the request? Shouldn’t that be an & rather than a ?

For WebAPI, I’m using docker’s ohdsi/webapi:2.13.0 with the following environment variables set BEFORE the Docker CMD. Notably, I have not rebuilt the war file and am using the container war.

SECURITY_PROVIDER=AtlasRegularSecurity
SECURITY_OAUTH_CALLBACK_UI=http://localhost/atlas
SECURITY_OAUTH_CALLBACK_API=http://localhost/WebAPI/user/oauth/callback
SECURITY_OAUTH_GOOGLE_APIKEY=<google cloud /apis/credentials/oauthclient client id>
SECURITY_OAUTH_GOOGLE_APISECRET=<google cloud /apis/credentials/oauthclient client secret>

For atlas, I am using the docker’s ohdsi/atlas:2.13.0 and the following config-local.js file

configLocal.userAuthenticationEnabled = true;
configLocal.enableSkipLogin = false;  // this isn't working, i can browse atlas without logging in :(
configLocal.authProviders = [{
  "name": "Google",
  "url": "user/oauth/google",
  "ajax": false,
  "icon": "fab fa-google"
}];

Would really appreciate any advice on how to debug! Thanks!

Have you made any progress with this? I have been trying the same and struggling, even after successfully testing my OAuth Consent Screen with another application.

Hi Sanjay,

Yes, I solved this via adding ?client_name=Google2Client to the callback URL

2 Likes

Hi @oliver - I’m an OAuth novice. Is this a common solution? Should we document in Broadsea?

Hi Ajit,

Thanks for reaching out. I also am no expert! Instructions would be most helpful in the WebAPI Installation Guide.

Of note, my google OAuth still doesn’t work (see this post).

Figured it out, needed to add the #/welcome part to my UI callback

1 Like
t