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.



51
52
53
# File 'lib/bosh/director/api/uaa_identity_provider.rb', line 51

def initialize(token)
  @token = token
end

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token.



49
50
51
# File 'lib/bosh/director/api/uaa_identity_provider.rb', line 49

def token
  @token
end

Instance Method Details

#clientObject



59
60
61
# File 'lib/bosh/director/api/uaa_identity_provider.rb', line 59

def client
  @token['client_id']
end

#scopesObject



67
68
69
# File 'lib/bosh/director/api/uaa_identity_provider.rb', line 67

def scopes
  @token['scope']
end

#usernameObject



63
64
65
# File 'lib/bosh/director/api/uaa_identity_provider.rb', line 63

def username
  @token['user_name']
end

#username_or_clientObject



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

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