Class: OmniAuth::Strategies::Authentiq

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omniauth/strategies/authentiq.rb,
lib/omniauth/strategies/oidc/back_channel_logout_request.rb

Defined Under Namespace

Classes: BackChannelLogoutRequest

Constant Summary collapse

BASE_URL =
'https://connect.authentiq.io/'

Instance Method Summary collapse

Instance Method Details

#add_openidObject



70
71
72
73
74
# File 'lib/omniauth/strategies/authentiq.rb', line 70

def add_openid
  unless options.scope.split.include? 'openid'
    options.scope = options.scope.split.push('openid').join(' ')
  end
end

#callback_phaseObject



66
67
68
# File 'lib/omniauth/strategies/authentiq.rb', line 66

def callback_phase
  should_sign_out? ? sign_out_phase : super
end

#callback_urlObject



62
63
64
# File 'lib/omniauth/strategies/authentiq.rb', line 62

def callback_url
  options[:callback_url] || (full_host + script_name + callback_path)
end

#decode_idtoken(idtoken) ⇒ Object



76
77
78
79
# File 'lib/omniauth/strategies/authentiq.rb', line 76

def decode_idtoken(idtoken)
  @jwt_info = JWT.decode idtoken, nil, false
  @jwt_info[0]
end

#raw_infoObject



56
57
58
59
60
# File 'lib/omniauth/strategies/authentiq.rb', line 56

def raw_info
  @raw_info ||= decode_idtoken(access_token.params['id_token'])
  request.update_param('sid', @raw_info['sid'])
  @raw_info
end

#request_phaseObject



51
52
53
54
# File 'lib/omniauth/strategies/authentiq.rb', line 51

def request_phase
  add_openid
  super
end

#should_sign_out?Boolean

Returns:

  • (Boolean)


81
82
83
# File 'lib/omniauth/strategies/authentiq.rb', line 81

def should_sign_out?
  request.post? && request.params.has_key?('logout_token')
end

#sign_out_phaseObject



85
86
87
88
89
# File 'lib/omniauth/strategies/authentiq.rb', line 85

def sign_out_phase
  if options[:enable_remote_sign_out]
    backchannel_logout_request.new(self, request).call(options)
  end
end