Class: OAuth2::Model::Client

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/oauth2/model/client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#client_secretObject

Returns the value of attribute client_secret.



27
28
29
# File 'lib/oauth2/model/client.rb', line 27

def client_secret
  @client_secret
end

Class Method Details

.create_client_idObject



21
22
23
24
25
# File 'lib/oauth2/model/client.rb', line 21

def self.create_client_id
  OAuth2.generate_id do |client_id|
    count(:conditions => {:client_id => client_id}).zero?
  end
end

Instance Method Details

#valid_client_secret?(secret) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/oauth2/model/client.rb', line 34

def valid_client_secret?(secret)
  BCrypt::Password.new(client_secret_hash) == secret
end