#29 new
activefx

[PATCH] open_id_authentication: yield failure message on result = :failed

Reported by activefx | August 7th, 2008 @ 08:00 AM

When the open id response status returns OpenID::Consumer::FAILURE, it is difficult to determine why, which is useful for security and debugging purposes. If openidresponse.message is the third parameter yielded back to the authenticatewithopen_id block, you can pass the parameter to the logger to help diagnose any problems. For example:


    authenticate_with_open_id(identity_url,
        :required => [ :nickname, :email],
        :optional => :fullname) do |result, identity_url, registration|
      case result.status
      when :missing
        failed_login "Sorry, the OpenID server couldn't be found"
      when :invalid
        failed_login "Sorry, but this does not appear to be a valid OpenID"
      when :canceled
        failed_login "OpenID verification was canceled"
      when :failed
	logger.warn registration
        failed_login "Sorry, the OpenID verification failed"

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Attachments