Class: OmniAuth::Strategies::Honin
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Honin
- Defined in:
- lib/omniauth/strategies/honin.rb
Constant Summary collapse
- PKCE_VERIFIER_LENGTH =
64
Instance Method Summary collapse
- #authorize_params ⇒ Object
- #callback_phase ⇒ Object
- #client ⇒ Object
- #decoded_jwt ⇒ Object
- #raw_info ⇒ Object
- #request_phase ⇒ Object
- #token_params ⇒ Object
Instance Method Details
#authorize_params ⇒ Object
48 49 50 51 52 53 |
# File 'lib/omniauth/strategies/honin.rb', line 48 def super.tap do |params| params[:code_challenge] = session[:honin_pkce_challenge] params[:code_challenge_method] = "S256" end end |
#callback_phase ⇒ Object
61 62 63 64 65 |
# File 'lib/omniauth/strategies/honin.rb', line 61 def callback_phase super ensure clear_pkce_session! end |
#client ⇒ Object
90 91 92 93 94 95 |
# File 'lib/omniauth/strategies/honin.rb', line 90 def client @client ||= ::OAuth2::Client.new(.client_id, .client_secret, site: ..site, authorize_url: "#{.base_path}/oauth/authorize", token_url: "#{.base_path}/oauth/token") end |
#decoded_jwt ⇒ Object
101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/omniauth/strategies/honin.rb', line 101 def decoded_jwt @decoded_jwt ||= begin token = access_token.token if jwks_verification_available? decode_verified_jwt(token) else decode_unverified_jwt(token) end end end |
#raw_info ⇒ Object
97 98 99 |
# File 'lib/omniauth/strategies/honin.rb', line 97 def raw_info @raw_info ||= decoded_jwt end |
#request_phase ⇒ Object
43 44 45 46 |
# File 'lib/omniauth/strategies/honin.rb', line 43 def request_phase generate_pkce! super end |
#token_params ⇒ Object
55 56 57 58 59 |
# File 'lib/omniauth/strategies/honin.rb', line 55 def token_params super.tap do |params| params[:code_verifier] = session[:honin_pkce_verifier] end end |