Skip to content

Instantly share code, notes, and snippets.

@abid-hussain
Last active March 28, 2017 16:54
Show Gist options
  • Save abid-hussain/8720578 to your computer and use it in GitHub Desktop.
Save abid-hussain/8720578 to your computer and use it in GitHub Desktop.
Base64 json encoding and SSO / Single Sign On integration
forumb_secret_key = "f5259ae089f1030b335cf1ef8166d568"
#//if your subdomain at some forum eg forumbee is like abc.forumbee.com then your "domain" => "abc"
params = { "domain" => "abc",
"uri" => "/sso/1/login",
"date" => (Time.now.utc.to_i*1000).to_s,
"email" => email,
"name" => name,
"key" => email
}
data_in_base64 = Base64.encode64(params.to_json).gsub(/\n/, '')
digest = Digest::SHA1.hexdigest forumb_secret_key+data_in_base64
"https://abc.forumbee.com/sso/1/login?digest=#{digest}&data=#{data_in_base64}"
@5-meo
Copy link

5-meo commented Mar 28, 2017

So, once I change values to reflect my forumbee account, where exactly do i put this file, and where do I put the link for logged in users (wordpress) so this will work? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment