Skip to content
Snippets Groups Projects
Commit 07fd394e authored by Paul des Garets's avatar Paul des Garets
Browse files

Mise à jour des urls

parent 6b2deedb
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ class RedmineOauthController < AccountController ...@@ -19,7 +19,7 @@ class RedmineOauthController < AccountController
redirect_to signin_path redirect_to signin_path
else else
token = oauth_client.auth_code.get_token(params[:code], :redirect_uri => oauth_google_callback_url) token = oauth_client.auth_code.get_token(params[:code], :redirect_uri => oauth_google_callback_url)
result = token.get('https://www.googleapis.com/oauth2/v1/userinfo') result = token.get('https://dev.my.ecp.fr/testapi/who')
info = JSON.parse(result.body) info = JSON.parse(result.body)
if info && info["verified_email"] if info && info["verified_email"]
if allowed_domain_for?(info["email"]) if allowed_domain_for?(info["email"])
...@@ -84,9 +84,9 @@ class RedmineOauthController < AccountController ...@@ -84,9 +84,9 @@ class RedmineOauthController < AccountController
def oauth_client def oauth_client
@client ||= OAuth2::Client.new(settings[:client_id], settings[:client_secret], @client ||= OAuth2::Client.new(settings[:client_id], settings[:client_secret],
:site => 'https://accounts.google.com', :site => 'https://dev.my.ecp.fr',
:authorize_url => '/o/oauth2/auth', :authorize_url => '/oauth/v2/auth',
:token_url => '/o/oauth2/token') :token_url => '/oauth/v2/token')
end end
def settings def settings
...@@ -94,6 +94,6 @@ class RedmineOauthController < AccountController ...@@ -94,6 +94,6 @@ class RedmineOauthController < AccountController
end end
def scopes def scopes
'https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile' 'default_scope'
end end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment