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/callback
in 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!