Class: Uservoice::Token
- Inherits:
-
Object
- Object
- Uservoice::Token
- Defined in:
- lib/uservoice_sso.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Class Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
8 9 10 |
# File 'lib/uservoice_sso.rb', line 8 def data @data end |
Class Method Details
.generate(options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/uservoice_sso.rb', line 10 def self.generate( = {}) .merge!({expires: (Time.zone.now.utc+5*60).to_s}) key = EzCrypto::Key.with_password ::Configuration[:uservoice_subdomain], ::Configuration[:uservoice_sso_key] encrypted = key.encrypt(.to_json) @data = Base64.encode64(encrypted).gsub(/\n/, '') @data.to_s end |