Closed DrIanGregory closed 2 years ago
Issue resolved by editing .env many times: https://github.com/gate-sso/gate/blob/master/.env.example
And reading this many many times: https://github.com/gate-sso/gate/blob/master/docs/oauth_setup.md
And running the following many many times:
sudo lsof -i -P -n | grep LISTEN
sudo kill -9
oAuth fails to obtain credentials.
Installed gate-sso in Ubuntu location /opt/gate. Running on port 82 and reverse proxy to 80. In .env: GATE_SERVER_URL=http://gate.orthogonal.trading/
Setup Google API keys.
Click on Single Sign on. Then when clicking on the Google email account to login with. gate-sso crashes with the error: "NoMethodError in Users::OmniauthCallbacksController#google_oauth2" "undefined method `[]' for nil:NilClass"
In file: app/controllers/users/omniauth_callbacks_controller.rb:7:in `google_oauth2'. The code lines causing the issue:
data = request.env['omniauth.auth'] domain = data['info']['email'].split('@').last
These are the parameters sent in the request:
Parameters:
{"state"=>"83d21c734d8daf7647a742553453067fc4c8d47b8fd1daf9", "code"=>"4/0AX4XfWhZWa6BTZxezs0M8UT-CIn2JEwDamE45JOD7T1ggkYVCAJR4V0ezeg9MoO5Z2XIzg", "scope"=>"email profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile openid", "authuser"=>"1", "hd"=>"orthogonal.trading", "prompt"=>"consent"}
Response Headers: None