Created
April 20, 2012 11:48
-
-
Save ringe/2427980 to your computer and use it in GitHub Desktop.
/.well-known/browserid with Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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