Class: NexaasID::Client::Identity

Inherits:
Base
  • Object
show all
Defined in:
lib/nexaas_id/client/identity.rb

Overview

Nexaas ID Client for resources owned by an Identity

API

Documentation:

Examples:

Obtaining a user's profile:

client = NexaasID::Client::Identity.new(user_credentials)
client.profile.get

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#sign_up

Constructor Details

#initialize(credentials, config = nil) ⇒ Identity

Creates an instance of this client.

Parameters:

  • The (#access_token, #access_token=, #refresh_token, #refresh_token=, #expires_at, #expires_at= #expires_in, #expires_in=)

    user credentials, obtained through the OAuth2 authorization flow.


22
23
24
25
26
# File 'lib/nexaas_id/client/identity.rb', line 22

def initialize(credentials, config = nil)
  super(config)
  @credentials = credentials
  @token = NexaasID::Client::ExceptionWrapper.new(OAuth2::AccessToken.from_hash(client, hash))
end

Instance Attribute Details

#credentialsObject (readonly)

Returns the value of attribute credentials


13
14
15
# File 'lib/nexaas_id/client/identity.rb', line 13

def credentials
  @credentials
end

Instance Method Details

#profileNexaasID::Resources::Profile

Provides a Profile resource.

Returns:


30
31
32
# File 'lib/nexaas_id/client/identity.rb', line 30

def profile
  NexaasID::Resources::Profile.new(api_token, config)
end

#widgetNexaasID::Resources::Widget

Provides a Widget resource.

Returns:


36
37
38
# File 'lib/nexaas_id/client/identity.rb', line 36

def widget
  NexaasID::Resources::Widget.new(api_token, config)
end