Class: OmniAuth::Strategies::Okta
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Okta
- Defined in:
- lib/omniauth/strategies/okta.rb
Constant Summary collapse
- DEFAULT_SCOPE =
%[openid profile email].freeze
Instance Method Summary collapse
- #access_token ⇒ Object
- #callback_phase ⇒ Object
- #callback_url ⇒ Object
- #oauth2_access_token ⇒ Object
- #raw_info ⇒ Object
- #request_phase ⇒ Object
- #validated_token(token) ⇒ Object
Instance Method Details
#access_token ⇒ Object
51 52 53 54 55 56 |
# File 'lib/omniauth/strategies/okta.rb', line 51 def access_token ::OAuth2::AccessToken.new(client, oauth2_access_token.token, { :expires_in => oauth2_access_token.expires_in, :expires_at => oauth2_access_token.expires_at }) end |
#callback_phase ⇒ Object
74 75 76 |
# File 'lib/omniauth/strategies/okta.rb', line 74 def callback_phase super end |
#callback_url ⇒ Object
78 79 80 |
# File 'lib/omniauth/strategies/okta.rb', line 78 def callback_url [:redirect_uri] || (full_host + script_name + callback_path) end |
#oauth2_access_token ⇒ Object
49 |
# File 'lib/omniauth/strategies/okta.rb', line 49 alias :oauth2_access_token :access_token |
#raw_info ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/omniauth/strategies/okta.rb', line 58 def raw_info if [:auth_server_id] [:auth_server_id] = [:auth_server_id] + "/" else [:auth_server_id] = "" end @_raw_info ||= access_token.get('/oauth2/' + [:auth_server_id] + 'v1/userinfo').parsed || {} rescue ::Errno::ETIMEDOUT raise ::Timeout::Error end |
#request_phase ⇒ Object
70 71 72 |
# File 'lib/omniauth/strategies/okta.rb', line 70 def request_phase super end |
#validated_token(token) ⇒ Object
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/omniauth/strategies/okta.rb', line 82 def validated_token(token) JWT.decode(token, nil, false, verify_iss: true, iss: [:issuer], verify_aud: true, aud: [:audience], verify_sub: true, verify_expiration: true, verify_not_before: true, verify_iat: true, verify_jti: false, leeway: [:jwt_leeway] ).first end |