Class: Bosh::Director::Api::UaaUser

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/api/uaa_identity_provider.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ UaaUser

Returns a new instance of UaaUser.



57
58
59
# File 'lib/bosh/director/api/uaa_identity_provider.rb', line 57

def initialize(token)
  @token = token
end

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token.



55
56
57
# File 'lib/bosh/director/api/uaa_identity_provider.rb', line 55

def token
  @token
end

Instance Method Details

#clientObject



65
66
67
# File 'lib/bosh/director/api/uaa_identity_provider.rb', line 65

def client
  @token['client_id']
end

#scopesObject



73
74
75
# File 'lib/bosh/director/api/uaa_identity_provider.rb', line 73

def scopes
  @token['scope']
end

#usernameObject



69
70
71
# File 'lib/bosh/director/api/uaa_identity_provider.rb', line 69

def username
  @token['user_name']
end

#username_or_clientObject



61
62
63
# File 'lib/bosh/director/api/uaa_identity_provider.rb', line 61

def username_or_client
  @token['user_name'] || @token['client_id']
end