Class: Jossoagent

Inherits:
Object
  • Object
show all
Defined in:
lib/josso_agent.rb

Instance Method Summary collapse

Constructor Details

#initialize(sso_identity_manager_endpoint_url = nil, sso_identity_provider_endpoint_url = nil) ⇒ Jossoagent

Returns a new instance of Jossoagent.



6
7
8
9
# File 'lib/josso_agent.rb', line 6

def initialize(sso_identity_manager_endpoint_url = nil,sso_identity_provider_endpoint_url = nil)
  @agent_identity_manager = SSOIdentityManager.new(sso_identity_manager_endpoint_url)
  @sso_identity_provider = SSOIdentityProvider.new(sso_identity_provider_endpoint_url)
end

Instance Method Details

#find_roles_by_username(username) ⇒ Object



11
12
13
# File 'lib/josso_agent.rb', line 11

def find_roles_by_username(username)
  @agent_identity_manager.findRolesByUsername(username)
end

#find_user(username) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/josso_agent.rb', line 15

def find_user(username)
  begin
    @roles = @agent_identity_manager.findUser(username)
  rescue SOAP::FaultError
    return nil
  else
    return @roles
  end
end

#find_user_in_session(josso_session_id) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/josso_agent.rb', line 25

def find_user_in_session(josso_session_id)
  begin
    @sso_user = @agent_identity_manager.findUserInSession(josso_session_id)
  rescue SOAP::FaultError
    return nil
  else
    return @sso_user
  end
end

#get_josso_session_id(josso_assertionid) ⇒ Object



35
36
37
38
39
40
41
42
43
# File 'lib/josso_agent.rb', line 35

def get_josso_session_id(josso_assertionid)
  begin
    @josso_session_id = @sso_identity_provider.resolveAuthenticationAssertion(josso_assertionid)
  rescue SOAP::FaultError
    return nil
  else
    return @josso_session_id
  end
end

#logout(josso_session_id) ⇒ Object



45
46
47
# File 'lib/josso_agent.rb', line 45

def logout(josso_session_id)
  @sso_identity_provider.globalSignoff(josso_session_id)
end