OHDSI / Broadsea

Broadsea deploys the core OHDSI technology stack (Atlas & R Hades), using cross-platform Docker container technology.
http://ohdsi.github.io/Broadsea/
Apache License 2.0
71 stars 54 forks source link

Having trouble using implementing oauth (Github) #122

Open Volpym opened 5 months ago

Volpym commented 5 months ago

Hello,

I successfully built Broadsea, and I'm now trying to add OAUTH security (through github) to my local instance.

I followed the documentation to set up all the variables but when I try to login I get "Bad Credentials"

This is my .env

############################################################################################################################################################
# Section 1:
# Broadsea Host
############################################################################################################################################################
DOCKER_ARCH="linux/amd64" # change this to linux/arm64 if using Mac Silicon, otherwise keep as-is
BROADSEA_HOST="127.0.0.1" # change to your host URL (without the http part)
HTTP_TYPE="http" # if using https, you need to add the crt and key files to the ./certs folder
BROADSEA_CERTS_FOLDER="./certs" 

############################################################################################################################################################
# Section 2: 
# Atlas GUI configuration
############################################################################################################################################################

ATLAS_INSTANCE_NAME="Broadsea"
ATLAS_COHORT_COMPARISON_RESULTS_ENABLED="false"
ATLAS_USER_AUTH_ENABLED="true" # set to true if using security, but ensure you fill out the WebAPI/Atlas security sections below
ATLAS_PLP_RESULTS_ENABLED="false"

############################################################################################################################################################
# Section 3: 
# WebAPI Database configuration
############################################################################################################################################################

# Keep as-is if using Broadsea to launch the WebAPI postgres, replace if using an external postgres instance
WEBAPI_DATASOURCE_URL="jdbc:postgresql://broadsea-atlasdb:5432/postgres"
WEBAPI_DATASOURCE_USERNAME="postgres"
WEBAPI_DATASOURCE_PASSWORD="mypass"
WEBAPI_DATASOURCE_OHDSI_SCHEMA="webapi"

############################################################################################################################################################
# Section 4: 
# Atlas security provider configuration 
############################################################################################################################################################

# Only modify if you are enabling security!

ATLAS_SECURITY_PROVIDER_TYPE="oauth" # ad, ldap, kerberos, openid, cas, oauth, iap, basic
ATLAS_SECURITY_PROVIDER_NAME="Github" # What to call the provider in the Atlas GUI (e.g. "OHDSI Active Directory")
ATLAS_SECURITY_ICON="fa-cubes" # font-awesome icon name
ATLAS_SECURITY_USE_FORM="true" # set to true for most security providers
ATLAS_SECURITY_USE_AJAX="true" # set to true for most security providers except CAS

############################################################################################################################################################
# Section 5: 
# WebAPI security configuration
############################################################################################################################################################

WEBAPI_SECURITY_PROVIDER="AtlasRegularSecurity" # Change to AtlasRegularSecurity

# OAuth
SECURITY_OAUTH_CALLBACK_UI="http://127.0.0.1/atlas/#/welcome"
SECURITY_OAUTH_CALLBACK_API="http://127.0.0.1/WebAPI/user/oauth/callback"
SECURITY_OAUTH_CALLBACK_URLRESOLVER="query"
SECURITY_AUTH_GOOGLE_ENABLED="false"
SECURITY_OAUTH_GOOGLE_APIKEY=
SECURITY_OAUTH_GOOGLE_APISECRET=
SECURITY_AUTH_FACEBOOK_ENABLED="false"
SECURITY_OAUTH_FACEBOOK_APIKEY=
SECURITY_OAUTH_FACEBOOK_APISECRET=
SECURITY_AUTH_GITHUB_ENABLED="true"
SECURITY_OAUTH_GITHUB_APIKEY="<my_api_key>"
SECURITY_OAUTH_GITHUB_APISECRET="<my_api_secret>"

On github's side this is what I have entered the following information

image