14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'app/services/forest_liana/authentication.rb', line 14
def verify_code_and_generate_token(params)
client = ForestLiana::OidcClientManager.get_client()
rendering_id = parse_state(params['state'])
client.authorization_code = params['code']
if Rails.env.development? || Rails.env.test?
OpenIDConnect.http_config do |config|
config.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
end
access_token_instance = client.access_token! 'none'
user = ForestLiana::AuthorizationGetter.authenticate(
rendering_id,
{ :forest_token => access_token_instance.instance_variable_get(:@access_token) },
)
return ForestLiana::Token.create_token(user, rendering_id)
end
|