infrastructure/machines/compute01/ds-fr/package/patches/secrets-fc.patch

40 lines
1.9 KiB
Diff
Raw Normal View History

diff --git a/config/secrets.yml b/config/secrets.yml
index 866fa6159..6fd49ee59 100644
--- a/config/secrets.yml
+++ b/config/secrets.yml
@@ -23,10 +23,10 @@ defaults: &defaults
identifier: <%= ENV['FC_PARTICULIER_ID'] %>
secret: <%= ENV['FC_PARTICULIER_SECRET'] %>
redirect_uri: https://<%= ENV['APP_HOST'] %>/france_connect/particulier/callback
- authorization_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/api/v1/authorize
- token_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/api/v1/token
- userinfo_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/api/v1/userinfo
- logout_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/api/v1/logout
+ authorization_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/ui/oauth2
+ token_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/oauth2/token
+ userinfo_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/oauth2/openid/demarches_dgn/userinfo
+ logout_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/oauth2/token/revoke
agent_connect:
identifier: <%= ENV['AGENT_CONNECT_ID'] %>
secret: <%= ENV['AGENT_CONNECT_SECRET'] %>
diff --git a/app/services/france_connect_service.rb b/app/services/france_connect_service.rb
index 31b2491c4..fd3d80530 100644
--- a/app/services/france_connect_service.rb
+++ b/app/services/france_connect_service.rb
@@ -23,11 +23,15 @@ class FranceConnectService
def self.retrieve_user_informations_particulier(code)
client = FranceConnectParticulierClient.new(code)
+ Rails.logger.fatal("Client: #{client.inspect}")
+ Rails.logger.fatal("Client token: #{client.access_token!(client_auth_method: :secret).userinfo!.inspect}")
user_info = client.access_token!(client_auth_method: :secret)
.userinfo!
.raw_attributes
+ Rails.logger.fatal("Info: #{user_info.inspect}")
+
FranceConnectInformation.new(
gender: user_info[:gender],
given_name: user_info[:given_name],