Module: Swiftype::SSO
- Defined in:
- lib/swiftype/sso.rb
Overview
Single sign-on for the Swiftype Dashboard.
Constant Summary
- BASE_URL =
'https://swiftype.com/sso'
Class Method Summary collapse
- .token(user_id, timestamp) ⇒ Object
-
.url(user_id) ⇒ Object
Generate a URL that a user can click on to be logged into the Swiftype Dashboard.
Class Method Details
.token(user_id, timestamp) ⇒ Object
16 17 18 |
# File 'lib/swiftype/sso.rb', line 16 def self.token(user_id, ) Digest::SHA1.hexdigest("#{user_id}:#{Swiftype.platform_client_secret}:#{}") end |
.url(user_id) ⇒ Object
Generate a URL that a user can click on to be logged into the Swiftype
Dashboard. This requires the platform_client_id
and
platform_client_secret
configuration options be set.
10 11 12 13 14 |
# File 'lib/swiftype/sso.rb', line 10 def self.url(user_id) = Time.now.to_i "#{BASE_URL}?user_id=#{user_id}&client_id=#{Swiftype.platform_client_id}×tamp=#{}&token=#{token(user_id, )}" end |