Class: OmniAuth::Strategies::Office365
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Office365
- Defined in:
- lib/omniauth/strategies/office365.rb
Overview
Implements an OmniAuth strategy to get a Microsoft Graph compatible token from Azure AD
Constant Summary collapse
- DEFAULT_SCOPE =
'openid email profile User.Read'
Instance Method Summary collapse
- #authorize_params ⇒ Object
-
#callback_url ⇒ Object
Override callback URL OmniAuth by default passes the entire URL of the callback, including query parameters.
- #raw_info ⇒ Object
Instance Method Details
#authorize_params ⇒ Object
47 48 49 50 51 52 53 54 55 |
# File 'lib/omniauth/strategies/office365.rb', line 47 def super.tap do |params| %w[display hd scope auth_type].each do |v| params[v.to_sym] = request.params[v] if request.params[v] end params[:scope] ||= DEFAULT_SCOPE end end |
#callback_url ⇒ Object
Override callback URL OmniAuth by default passes the entire URL of the callback, including query parameters. Azure fails validation because that doesn’t match the registered callback.
61 62 63 |
# File 'lib/omniauth/strategies/office365.rb', line 61 def callback_url [:redirect_uri] || (full_host + script_name + callback_path) end |
#raw_info ⇒ Object
41 42 43 44 45 |
# File 'lib/omniauth/strategies/office365.rb', line 41 def raw_info # Get user profile information from the /me endpoint @raw_info ||= verify_hd @raw_info end |