Method: Crowd.find_principal_by_username

Defined in:
lib/crowd.rb

.find_principal_by_username(username) ⇒ Object

Find Principal via username



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/crowd.rb', line 165

def self.find_principal_by_username(username)
  response = authenticated_connection do
    arg = FindPrincipalByName.new(@@application_token, username)
    server.findPrincipalByName(arg)      
  end

  case response
    when FindPrincipalByNameResponse
      return parse_principal(response.out)
    when ObjectNotFoundException
      return nil
    else
      raise AuthenticationException, response
  end
end