class NexaasID::Client::Application

Nexaas ID Client for resources not owned by an Identity

API

Documentation:

@example Inviting a new user:

client = NexaasID::Client::Application.new
client.sign_up.create(invited: 'john.doe@example.com')

Attributes

tokens[R]

Public Class Methods

new(config = nil) click to toggle source
Calls superclass method NexaasID::Client::Base::new
# File lib/nexaas_id/client/application.rb, line 13
def initialize(config = nil)
  super(config)
  @tokens = {}
end

Protected Instance Methods

api_token() click to toggle source
# File lib/nexaas_id/client/application.rb, line 20
def api_token
  token(:invite)
end

Private Instance Methods

token(scope = nil) click to toggle source
# File lib/nexaas_id/client/application.rb, line 28
def token(scope = nil)
  token = tokens[scope]
  return token unless token.nil? || token.expired?
  tokens[scope] = NexaasID::Client::ExceptionWrapper.new(client.client_credentials.get_token(scope: scope))
end