Class: OmniAuth::Strategies::AzureActiveDirectory

Inherits:
Object
  • Object
show all
Includes:
AzureActiveDirectory, OmniAuth::Strategy
Defined in:
lib/omniauth/strategies/azure_activedirectory.rb

Overview

A strategy for authentication against Azure Active Directory.

Defined Under Namespace

Classes: OAuthError

Constant Summary collapse

DEFAULT_RESPONSE_TYPE =
'code id_token'
DEFAULT_RESPONSE_MODE =
'form_post'

Constants included from AzureActiveDirectory

AzureActiveDirectory::VERSION

Instance Method Summary collapse

Instance Method Details

#callback_phaseObject

Overridden method from OmniAuth::Strategy. This is the second step in the authentication process. It is called after the user enters credentials at the authorization endpoint.



86
87
88
89
90
91
92
93
94
95
# File 'lib/omniauth/strategies/azure_activedirectory.rb', line 86

def callback_phase
  error = request.params['error_reason'] || request.params['error']
  fail(OAuthError, error) if error
  @session_state = request.params['session_state']
  @id_token = request.params['id_token']
  @code = request.params['code']
  @claims, @header = validate_and_parse_id_token(@id_token)
  validate_chash(@code, @claims, @header)
  super
end

#request_phaseObject

Overridden method from OmniAuth::Strategy. This is the first step in the authentication process.



78
79
80
# File 'lib/omniauth/strategies/azure_activedirectory.rb', line 78

def request_phase
  redirect authorize_endpoint_url
end