# Open\_id\_authentication - authenticate\_with\_open\_id

**URL:** <https://www.ruby-forum.com/t/open-id-authentication-authenticate-with-open-id/135289>\
**Category:** Rails\
**Created:** [April 20, 2008, 7:17pm UTC](https://www.ruby-forum.com/t/open-id-authentication-authenticate-with-open-id/135289 "2008-04-20T19:17:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@Sav](https://www.ruby-forum.com/u/Sav)\
**Post date:** [April 20, 2008, 7:17pm UTC](https://www.ruby-forum.com/t/open-id-authentication-authenticate-with-open-id/135289/1 "2008-04-20T19:17:21Z")

</div>

I’m using the open\_id\_authentication plugin just like the README  
says. However, when I submit my openid\_url, the  
authenticate\_with\_open\_id method gives me the error below.

vendor/plugins/open\_id\_authentication/lib/open\_id\_authentication.rb:  
150:in `+' vendor/plugins/open_id_authentication/lib/open_id_authentication.rb: 150:in `requested\_url’  
vendor/plugins/open\_id\_authentication/lib/open\_id\_authentication.rb:  
146:in `open_id_redirect_url' vendor/plugins/open_id_authentication/lib/open_id_authentication.rb: 97:in `begin\_open\_id\_authentication’  
vendor/plugins/open\_id\_authentication/lib/open\_id\_authentication.rb:  
86:in `authenticate_with_open_id' app/controllers/account_controller.rb:33:in `open\_id\_authentication’  
app/controllers/account\_controller.rb:12:in `create’

It seems to be failing here, but I have no idea why…

def requested\_url  
“#{request.protocol + request.host\_with\_port +  
request.relative\_url\_root + request.path}”  
end

I’ve tested to ensure that “[username.myopenid.com](http://username.myopenid.com)” is being passed as  
the openid\_url parameter. Am I missing something else?

---

<div class="post-metadata">

**Author:** ![Sav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@Sav](https://www.ruby-forum.com/u/Sav)\
**Post date:** [April 20, 2008, 7:32pm UTC](https://www.ruby-forum.com/t/open-id-authentication-authenticate-with-open-id/135289/2 "2008-04-20T19:32:03Z")

</div>

If I change the url, it starts works except the redirect back is  
wrong…

def requested\_url  
“#{open\_id\_complete\_url}”  
end

Any ideas why the normal request would be null?..  
“#{request.protocol + request.host\_with\_port +  
request.relative\_url\_root + request.path}”

---

<div class="post-metadata">

**Author:** ![Sav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@Sav](https://www.ruby-forum.com/u/Sav)\
**Post date:** [June 1, 2008, 8:14pm UTC](https://www.ruby-forum.com/t/open-id-authentication-authenticate-with-open-id/135289/3 "2008-06-01T20:14:51Z")

</div>

If anyone else ever runs into this problem (because I just did again),  
I removed request.relative\_url\_root and it works now…

def requested\_url

# "#{request.protocol + request.host\_with\_port +

request.relative\_url\_root + request.path}"  
“#{request.protocol + request.host\_with\_port + request.path}”  
end

The original code gave this error…

can’t convert nil into String

vendor/plugins/open\_id\_authentication/lib/open\_id\_authentication.rb:  
154:in `+’
