Class: OmniAuth::Strategies::SSOProvider

Inherits:
OAuth2
  • Object
show all
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:

  1. Redirect to the authorization endpoint.
  2. Exchange the authorization code for an access token.
  3. Fetch user information (the "info" hash) using the access token.

Instance Method Summary collapse

Instance Method Details

#raw_infoObject

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(options.).parsed || {}
rescue ::OAuth2::Error => e
  # Raise an error if fetching user info fails (e.g., expired token, 401 response)
  raise e
end