Skip to content

Instantly share code, notes, and snippets.

@ringe
Created April 20, 2012 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ringe/2427980 to your computer and use it in GitHub Desktop.
Save ringe/2427980 to your computer and use it in GitHub Desktop.
/.well-known/browserid with Ruby
privkey = OpenSSL::PKey::RSA.new(2048)
pubkey = privkey.public_key
# Return BrowserID Identity JSON
def to_json
{
"public-key" => { "algorithm"=> "RS", "n" => public_key.n.to_s, "e" => public_key.e.to_s },
"authentication" => "/sign_in",
"provisioning" => "/provision"
}.to_json
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment