2016-01-21 17:06:09 +01:00
|
|
|
class FranceConnectSaltService
|
|
|
|
attr_reader :model
|
|
|
|
|
|
|
|
def initialize france_connect_information
|
2018-01-11 19:04:39 +01:00
|
|
|
raise 'Not a FranceConnectInformation class' if france_connect_information.class != FranceConnectInformation
|
2016-01-21 17:06:09 +01:00
|
|
|
@model = france_connect_information
|
|
|
|
end
|
|
|
|
|
|
|
|
def valid? test_salt
|
|
|
|
salt == test_salt
|
|
|
|
end
|
|
|
|
|
|
|
|
def salt
|
2018-01-15 12:07:54 +01:00
|
|
|
Digest::MD5.hexdigest(model.france_connect_particulier_id + model.given_name + model.family_name + FRANCE_CONNECT.particulier.secret + DateTime.now.to_date.to_s)
|
2016-01-21 17:06:09 +01:00
|
|
|
end
|
2017-04-04 15:27:04 +02:00
|
|
|
end
|