From 1d902199702357a285e347589c57de42078ebc7a Mon Sep 17 00:00:00 2001 From: Roger Meier Date: Sun, 26 Apr 2020 09:50:13 +0200 Subject: [PATCH] refactor: take uid_field from raw_attributes (#54) --- lib/omniauth/strategies/openid_connect.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/omniauth/strategies/openid_connect.rb b/lib/omniauth/strategies/openid_connect.rb index 84ad1caf..891d79ec 100644 --- a/lib/omniauth/strategies/openid_connect.rb +++ b/lib/omniauth/strategies/openid_connect.rb @@ -58,10 +58,7 @@ class OpenIDConnect option :uid_field, 'sub' def uid - user_info.public_send(options.uid_field.to_s) - rescue NoMethodError - log :warn, "User sub:#{user_info.sub} missing info field: #{options.uid_field}" - user_info.sub + user_info.raw_attributes[options.uid_field.to_sym] || user_info.sub end info do