Stuck with open_id_authentication plugin

Hi,

I am trying to get the open_id_authentication plugin to work with the
current edge rails, and here is what I am stuck with:

In the case statement in the authenticate_with_open_id method** (below,
copied from the plugin’s readme file), none of the cases seems to
evaluate to true and instead, the ‘else’ part is executed. This seems
odd since when I put the following in a template:

Identity Url:
<%= @identity_url %>
Result:
<%= debug(@result) %>
Successful:
<%= @result === :successful %>
Current user:
<%= @current_user.full_name %>

I get the following output:

Identity Url:
http://www.ingoweiss.com/
Result:

--- !ruby/object:OpenIdAuthentication::Result
code: :successful

Successful:
true
Current user:
Ingo W.

I just don’t get why the ‘case :successful’ part in the case statement
is never executed even though ‘@result === :successful’ evaluates to
true!

Ingo

**In the controller:

def open_id_authentication
authenticate_with_open_id do |result, identity_url|
case result
when :missing
failed_login “Sorry, the OpenID server couldn’t be found”
when :canceled
failed_login “OpenID verification was canceled”
when :failed
failed_login “Sorry, the OpenID verification failed”
when :successful
if @current_user = User.find_by_identity_url(identity_url)
successful_login
else
failed_login “Sorry, no user by that identity URL exists
(#{identity_url})”
end
else
#just for debugging:
@result = result
@identity_url = identity_url
@current_user = User.find_by_identity_url(identity_url)
end
end
end

Now this is strange, I replaced the case statement with a giant, ugly
‘if…elsif…else’ statement and now it works just fine!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs