Class: OmniAuth::Strategies::AzureDevops

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omni_auth/strategies/azure_devops.rb

Instance Method Summary collapse

Instance Method Details

#callback_urlObject



50
51
52
# File 'lib/omni_auth/strategies/azure_devops.rb', line 50

def callback_url
  full_host + callback_path
end

#raw_infoObject



35
36
37
# File 'lib/omni_auth/strategies/azure_devops.rb', line 35

def raw_info
  @raw_info ||= access_token.get('/_apis/profile/profiles/me').parsed
end

#token_paramsObject



39
40
41
42
43
44
45
46
47
48
# File 'lib/omni_auth/strategies/azure_devops.rb', line 39

def token_params
  super.tap do |params|
    params[:headers] = { 'Content-Type': 'application/x-www-form-urlencoded' }
    params[:client_assertion_type] = 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'
    params[:client_assertion] = client.secret
    params[:grant_type] = 'urn:ietf:params:oauth:grant-type:jwt-bearer'
    params[:assertion] = request.params['code']
    params[:redirect_uri] = callback_url
  end
end