Class: OmniAuth::Strategies::SSOProvider
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::SSOProvider
- Defined in:
- lib/omniauth/strategies/ssoprovider.rb
Overview
OmniAuth Strategy for a generic SSO Provider using OAuth 2.0. This class handles the standard OAuth flow:
- Redirect to the authorization endpoint.
- Exchange the authorization code for an access token.
- Fetch user information (the "info" hash) using the access token.
Instance Method Summary collapse
-
#raw_info ⇒ Object
This method is called after the token exchange is successful.
Instance Method Details
#raw_info ⇒ Object
This method is called after the token exchange is successful. It uses the access token to call the SSO's user info API.
57 58 59 60 61 62 |
# File 'lib/omniauth/strategies/ssoprovider.rb', line 57 def raw_info @raw_info ||= access_token.get(.user_info_url).parsed || {} rescue ::OAuth2::Error => e # Raise an error if fetching user info fails (e.g., expired token, 401 response) raise e end |