# Stuck with open\_id\_authentication plugin

**URL:** <https://www.ruby-forum.com/t/stuck-with-open-id-authentication-plugin/103805>\
**Category:** Rails\
**Created:** [May 10, 2007, 2:45pm UTC](https://www.ruby-forum.com/t/stuck-with-open-id-authentication-plugin/103805 "2007-05-10T14:45:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ingoweiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/77aa72/32.png) [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Post date:** [May 10, 2007, 2:45pm UTC](https://www.ruby-forum.com/t/stuck-with-open-id-authentication-plugin/103805/1 "2007-05-10T14:45:10Z")

</div>

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/](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

---

<div class="post-metadata">

**Author:** ![ingoweiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/77aa72/32.png) [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Post date:** [May 10, 2007, 7:05pm UTC](https://www.ruby-forum.com/t/stuck-with-open-id-authentication-plugin/103805/2 "2007-05-10T19:05:06Z")

</div>

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