Class: OAuth2c::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/oauth2c/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authz_url: nil, token_url:, client_id:, client_secret: nil, redirect_uri: nil, default_scope: [], client_credentials_on_body: false) ⇒ Client

Returns a new instance of Client.



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/oauth2c/client.rb', line 28

def initialize(authz_url: nil, token_url:, client_id:, client_secret: nil,
               redirect_uri: nil, default_scope: [],
               client_credentials_on_body: false)
  @authz_url                  = authz_url
  @token_url                  = token_url
  @client_id                  = client_id
  @client_secret              = client_secret
  @redirect_uri               = redirect_uri
  @default_scope              = default_scope
  @client_credentials_on_body = client_credentials_on_body

  define_grant_methods!
end

Instance Attribute Details

#authz_urlObject (readonly)

Returns the value of attribute authz_url.



19
20
21
# File 'lib/oauth2c/client.rb', line 19

def authz_url
  @authz_url
end

#client_idObject (readonly)

Returns the value of attribute client_id.



19
20
21
# File 'lib/oauth2c/client.rb', line 19

def client_id
  @client_id
end

#client_secretObject (readonly)

Returns the value of attribute client_secret.



19
20
21
# File 'lib/oauth2c/client.rb', line 19

def client_secret
  @client_secret
end

#redirect_uriObject (readonly)

Returns the value of attribute redirect_uri.



19
20
21
# File 'lib/oauth2c/client.rb', line 19

def redirect_uri
  @redirect_uri
end

#token_urlObject (readonly)

Returns the value of attribute token_url.



19
20
21
# File 'lib/oauth2c/client.rb', line 19

def token_url
  @token_url
end