# OpenID authentication

**URL:** <https://www.ruby-forum.com/t/openid-authentication/153942>\
**Category:** Rails\
**Created:** [November 23, 2008, 2:14pm UTC](https://www.ruby-forum.com/t/openid-authentication/153942 "2008-11-23T14:14:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![PanosJee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/90db22/32.png) [@PanosJee](https://www.ruby-forum.com/u/PanosJee)\
**Post date:** [November 23, 2008, 2:14pm UTC](https://www.ruby-forum.com/t/openid-authentication/153942/1 "2008-11-23T14:14:50Z")

</div>

Hi there, I am trying to use the OpenID authentication plugin of DHH  
in conjuction with ruby-openid 2.1.2 gem put it seems there is a  
problem because in my login action the plugin redirects me to the  
openid provider and then i have the exception when i have to render or  
redirect to another page  
The exception is:  
ActionController::DoubleRenderError (Can only render or redirect once  
per action):

Have you even encountered smth like that ?

Thank you

PS my session starts successfully the problem is that it does not  
refresh the page or redirect somewhere so i have to do it manually to  
see tha i am logged in

---

<div class="post-metadata">

**Author:** ![PanosJee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/90db22/32.png) [@PanosJee](https://www.ruby-forum.com/u/PanosJee)\
**Post date:** [November 24, 2008, 11:49pm UTC](https://www.ruby-forum.com/t/openid-authentication/153942/2 "2008-11-24T23:49:05Z")

</div>

## You might want to take a look at the OpenID Rails Kit ( [http://railskits.com/openid/](http://railskits.com/openid/)), which gives you a Rails sample app with the openid plugin integrated with the restful\_authentication plugin so you can have both types of logins, ready to go.

Benjamin C.  
[http://railskits.com/](http://railskits.com/) - Ready-made Rails code  
[http://catchthebest.com/](http://catchthebest.com/) - Team-powered recruiting  
[http://www.bencurtis.com/](http://www.bencurtis.com/) - Personal blog

---

<div class="post-metadata">

**Author:** ![PanosJee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/90db22/32.png) [@PanosJee](https://www.ruby-forum.com/u/PanosJee)\
**Post date:** [November 25, 2008, 6:56am UTC](https://www.ruby-forum.com/t/openid-authentication/153942/3 "2008-11-25T06:56:43Z")

</div>

I second Ben, check out a working demonstration application and see what  
you are doing different. It sounds like you may be doing some rendering  
outside of the authenticate\_with\_open\_id block, but its hard to say  
without seeing your code.

---

<div class="post-metadata">

**Author:** ![PanosJee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/90db22/32.png) [@PanosJee](https://www.ruby-forum.com/u/PanosJee)\
**Post date:** [November 25, 2008, 10:02pm UTC](https://www.ruby-forum.com/t/openid-authentication/153942/4 "2008-11-25T22:02:52Z")

</div>

Ok guys i ll give a second look, the strange thing is tha my current  
setup works but i am rewriting to port it Rails 2.x.x but somethings  
goes fundamendally wrong.  
So far the problem is that OpenID redirects as it should do but then i  
cannot redirect back to index and say hello user

---

<div class="post-metadata">

**Author:** ![PanosJee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/90db22/32.png) [@PanosJee](https://www.ruby-forum.com/u/PanosJee)\
**Post date:** [November 25, 2008, 10:23pm UTC](https://www.ruby-forum.com/t/openid-authentication/153942/5 "2008-11-25T22:23:57Z")

</div>

What I have in my log is:

OpenIdAuthentication::Association Load (0.000810) SELECT \* FROM  
`open_id_authentication_associations` WHERE  
(`open_id_authentication_associations`.`server_url` = ‘http://  
[www.myopenid.com/server](http://www.myopenid.com/server)’)  
Redirected to  
[http://www.myopenid.com/server?openid.assoc\_handle={HMAC-SHA1}{492c6b8f}{at%2BLWQ%3D%3D}&openid.claimed\_id=http%3A%2F%2F6pna.com%2F&openid.identity=http%3A%2F%2Fpanosjee.myopenid.com%2F&openid.mode=checkid\_setup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.ns.sreg=http%3A%2F%2Fopenid.net%2Fextensions%2Fsreg%2F1.1&openid.realm=http%3A%2F%2F127.0.0.1%3A3000%2F&openid.return\_to=http%3A%2F%2F127.0.0.1%3A3000%2Flogin%2Fnow%3F\_method%3Dpost%26open\_id\_complete%3D1](http://www.myopenid.com/server?openid.assoc_handle=%7BHMAC-SHA1%7D%7B492c6b8f%7D%7Bat%2BLWQ%3D%3D%7D&openid.claimed_id=http%3A%2F%2F6pna.com%2F&openid.identity=http%3A%2F%2Fpanosjee.myopenid.com%2F&openid.mode=checkid_setup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.ns.sreg=http%3A%2F%2Fopenid.net%2Fextensions%2Fsreg%2F1.1&openid.realm=http%3A%2F%2F127.0.0.1%3A3000%2F&openid.return_to=http%3A%2F%2F127.0.0.1%3A3000%2Flogin%2Fnow%3F_method%3Dpost%26open_id_complete%3D1)

and then  
ActionController::DoubleRenderError (Can only render or redirect once  
per action):  
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.2/lib/action\_controller/  
base.rb:842:in `render\_with\_no\_layout’

It fails only when openid url is correct, quite strange

---

<div class="post-metadata">

**Author:** ![PanosJee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/90db22/32.png) [@PanosJee](https://www.ruby-forum.com/u/PanosJee)\
**Post date:** [November 26, 2008, 11:03pm UTC](https://www.ruby-forum.com/t/openid-authentication/153942/6 "2008-11-26T23:03:40Z")

</div>

Just in case anyone stumbs on this thread again:

You should go exactly what the sample code does and that is why the  
plugin is looking for a identity\_url or openid\_url param  
So in your form there should be a an input with name anything like user  
[identity\_url] wont do!
