Created
March 24, 2010 14:23
-
-
Save ku1ik/342330 to your computer and use it in GitHub Desktop.
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
class OpenIDStrategy < Warden::Strategies::Base | |
def authenticate! | |
if resp = request.env['rack.openid.response'] | |
if resp.status == :failure || resp.status == :missing | |
fail! "OpenID authentication failed" | |
end | |
elsif openid_url = request.params[:openid_url] | |
custom!([401, { "WWW-Authenticate" => "OpenID identifier=\"#{openid_url}\"" }, []]) | |
end | |
end | |
end | |
Warden::Strategies.add(:openid, OpenIDStrategy) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment