Skip to content

Instantly share code, notes, and snippets.

@afeld
Created December 24, 2011 23:02
Show Gist options
  • Select an option

  • Save afeld/1518504 to your computer and use it in GitHub Desktop.

Select an option

Save afeld/1518504 to your computer and use it in GitHub Desktop.
Assistly multipass SSO
multipass = MultiPass.encode(
'jux',
api_key,
:customer_name => current_user.displayname,
:customer_email => current_user.email,
:customer_custom_username => current_user.username,
:uid => current_user.id,
:expires => (Time.now + 120), # Expire two minutes from now
:url_safe => true # Convert unsafe characters
)
escaped_multipass = URI.escape(multipass, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
redirect_to "http://helpers.jux.com/customer/authentication/multipass/callback?multipass=#{multipass}" # hmm, should be using 'escaped_multipass'...?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment