Class: OmniAuth::Strategies::Josso::Agent

Inherits:
Object
  • Object
show all
Defined in:
lib/omniauth/strategies/josso.rb

Instance Method Summary collapse

Constructor Details

#initialize(endpoint_url, josso_assertion_id) ⇒ Agent

Returns a new instance of Agent.



36
37
38
39
# File 'lib/omniauth/strategies/josso.rb', line 36

def initialize(endpoint_url, josso_assertion_id)
  @endpoint_url = endpoint_url
  @josso_assertion_id = josso_assertion_id
end

Instance Method Details

#identity_managerObject



41
42
43
# File 'lib/omniauth/strategies/josso.rb', line 41

def identity_manager
  @identity_manager ||= Savon.client wsdl: "#{@endpoint_url}/josso/services/SSOIdentityManager?wsdl", soap_version: 1, ssl_verify_mode: :none
end

#identity_providerObject



45
46
47
# File 'lib/omniauth/strategies/josso.rb', line 45

def identity_provider
  @identity_provider ||= Savon.client wsdl: "#{@endpoint_url}/josso/services/SSOIdentityProvider?wsdl", soap_version: 1, ssl_verify_mode: :none
end

#session_idObject



49
50
51
52
53
54
# File 'lib/omniauth/strategies/josso.rb', line 49

def session_id
  @session_id ||= begin
    res = identity_provider.call :resolve_authentication_assertion, message: { 'in0' => @josso_assertion_id }
    res.to_hash[:resolve_authentication_assertion_response][:resolve_authentication_assertion_return]
  end
end

#userObject



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

def user
  @user ||= begin
    res = identity_manager.call :find_user_in_session, message: { 'in0' => session_id }
    res.to_hash[:multi_ref]
  end
end