Class: AuthRocket::Credential

Inherits:
Resource
  • Object
show all
Defined in:
lib/authrocket/credential.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



12
13
14
# File 'lib/authrocket/credential.rb', line 12

def access_token
  @access_token
end

#client_app_nameObject (readonly)

Returns the value of attribute client_app_name.



14
15
16
# File 'lib/authrocket/credential.rb', line 14

def client_app_name
  @client_app_name
end

#credential_typeObject (readonly)

Returns the value of attribute credential_type.



9
10
11
# File 'lib/authrocket/credential.rb', line 9

def credential_type
  @credential_type
end

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/authrocket/credential.rb', line 11

def name
  @name
end

#otp_secretObject (readonly)

Returns the value of attribute otp_secret.



11
12
13
# File 'lib/authrocket/credential.rb', line 11

def otp_secret
  @otp_secret
end

#passwordObject (readonly)

writeonly



10
11
12
# File 'lib/authrocket/credential.rb', line 10

def password
  @password
end

#provisioning_svgObject (readonly)

Returns the value of attribute provisioning_svg.



11
12
13
# File 'lib/authrocket/credential.rb', line 11

def provisioning_svg
  @provisioning_svg
end

#provisioning_uriObject (readonly)

Returns the value of attribute provisioning_uri.



11
12
13
# File 'lib/authrocket/credential.rb', line 11

def provisioning_uri
  @provisioning_uri
end

#stateObject (readonly)

Returns the value of attribute state.



11
12
13
# File 'lib/authrocket/credential.rb', line 11

def state
  @state
end

Instance Method Details

#verify(code, attribs = {}) ⇒ Object

code - required



22
23
24
25
26
27
# File 'lib/authrocket/credential.rb', line 22

def verify(code, attribs={})
  params = parse_request_params(attribs.merge(code: code), json_root: json_root).reverse_merge credentials: api_creds
  parsed, _ = request(:post, resource_path+'/verify', params)
  load(parsed)
  errors.empty? ? self : false
end