2015-10-06 11:21:20 +02:00
|
|
|
class FranceConnectService
|
2015-12-18 12:01:26 +01:00
|
|
|
def self.retrieve_user_informations_entreprise code
|
|
|
|
client = FranceConnectEntrepriseClient.new code: code
|
2015-10-06 11:21:20 +02:00
|
|
|
|
2015-10-06 11:47:42 +02:00
|
|
|
access_token = client.access_token!(client_auth_method: :secret)
|
2015-10-07 12:01:05 +02:00
|
|
|
user_info = access_token.userinfo!
|
|
|
|
Hashie::Mash.new user_info.raw_attributes
|
2015-10-06 11:21:20 +02:00
|
|
|
end
|
2015-12-24 10:12:23 +01:00
|
|
|
|
|
|
|
def self.retrieve_user_informations_particulier code
|
|
|
|
client = FranceConnectParticulierClient.new code: code
|
|
|
|
|
|
|
|
access_token = client.access_token!(client_auth_method: :secret)
|
|
|
|
user_info = access_token.userinfo!
|
|
|
|
hash = Hashie::Mash.new user_info.raw_attributes
|
|
|
|
|
|
|
|
hash.france_connect_particulier_id = hash.sub
|
|
|
|
hash
|
|
|
|
end
|
2015-10-06 11:21:20 +02:00
|
|
|
end
|