# Curling REST controllers behind restful\_authentication

**URL:** <https://www.ruby-forum.com/t/curling-rest-controllers-behind-restful-authentication/142807>\
**Category:** Rails\
**Created:** [July 11, 2008, 6:50pm UTC](https://www.ruby-forum.com/t/curling-rest-controllers-behind-restful-authentication/142807 "2008-07-11T18:50:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![thejackal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/919ad9/32.png) [@thejackal](https://www.ruby-forum.com/u/thejackal)\
**Post date:** [July 11, 2008, 6:50pm UTC](https://www.ruby-forum.com/t/curling-rest-controllers-behind-restful-authentication/142807/1 "2008-07-11T18:50:40Z")

</div>

Hello,

I am trying to access a REST controller from a Native C# Windows Mobile  
client and I am having some problems since I am using the  
restful\_authentication plug in.

I decided to test the availability of the resources with curl before  
trying with windows mobile.

I want to access this resource

[http://friendforcaster.com/users/1/people.xml](http://friendforcaster.com/users/1/people.xml)

When I try to I get the obvious

HTTP Basic: Access denied.

So I though I would try

curl -X GET --basic -u user\_name:password  
[http://friendforcaster.com/users/1/people.xml](http://friendforcaster.com/users/1/people.xml)

But had the same problem…

I was thinking that maybe I have to somehow remotely add a cookie or  
create a session but I don’t know how to do this.

Can someone help?

Thank you very much,

Kent

---

<div class="post-metadata">

**Author:** ![thejackal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/919ad9/32.png) [@thejackal](https://www.ruby-forum.com/u/thejackal)\
**Post date:** [July 11, 2008, 8:36pm UTC](https://www.ruby-forum.com/t/curling-rest-controllers-behind-restful-authentication/142807/2 "2008-07-11T20:36:34Z")

</div>

Got it!

It was a problem with Apache!

Thank you

Kent

Kent F. wrote:

> Hello,
> 
> I am trying to access a REST controller from a Native C# Windows Mobile  
> client and I am having some problems since I am using the  
> restful\_authentication plug in.
> 
> I decided to test the availability of the resources with curl before  
> trying with windows mobile.
> 
> I want to access this resource
> 
> [http://friendforcaster.com/users/1/people.xml](http://friendforcaster.com/users/1/people.xml)
> 
> When I try to I get the obvious
> 
> HTTP Basic: Access denied.
> 
> So I though I would try
> 
> curl -X GET --basic -u user\_name:password  
> [http://friendforcaster.com/users/1/people.xml](http://friendforcaster.com/users/1/people.xml)
> 
> But had the same problem…
> 
> I was thinking that maybe I have to somehow remotely add a cookie or  
> create a session but I don’t know how to do this.
> 
> Can someone help?
> 
> Thank you very much,
> 
> Kent

---

<div class="post-metadata">

**Author:** ![thejackal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/919ad9/32.png) [@thejackal](https://www.ruby-forum.com/u/thejackal)\
**Post date:** [July 11, 2008, 8:56pm UTC](https://www.ruby-forum.com/t/curling-rest-controllers-behind-restful-authentication/142807/3 "2008-07-11T20:56:56Z")

</div>

On Jul 11, 1:36 pm, Kent F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Got it!
> 
> It was a problem with Apache!
> 
> Thank you
> 
> Kent

Can you elaborate? I had seen this before in one of my projects and  
I’m curious to know how you solved it.

Jeff

---

<div class="post-metadata">

**Author:** ![thejackal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/919ad9/32.png) [@thejackal](https://www.ruby-forum.com/u/thejackal)\
**Post date:** [July 11, 2008, 9:04pm UTC](https://www.ruby-forum.com/t/curling-rest-controllers-behind-restful-authentication/142807/4 "2008-07-11T21:04:56Z")

</div>

Hi Jeff,

I tried it out on my local copy and it worked really well.

I still can’t access it remotely but that has something to do with the  
host I am using.

I am using hostingrails and I have opened up a ticket with them.  
Chances are it has something to do with the FCI or Apache config files.

On my dev machine I switched from Apache to nginx and everything worked  
very well. Unless you are using passenger I would suggest not using  
Apache, but that’s just my opinion.

Hope this helps, if my host gives me any information I will be happy to  
post it.

Thanks Jeff,

Kent

Jeff C. wrote:

> On Jul 11, 1:36ï¿½pm, Kent F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > Got it!
> > 
> > It was a problem with Apache!
> > 
> > Thank you
> > 
> > Kent
> 
> Can you elaborate? I had seen this before in one of my projects and  
> I’m curious to know how you solved it.
> 
> Jeff

---

<div class="post-metadata">

**Author:** ![thejackal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/919ad9/32.png) [@thejackal](https://www.ruby-forum.com/u/thejackal)\
**Post date:** [July 11, 2008, 11:56pm UTC](https://www.ruby-forum.com/t/curling-rest-controllers-behind-restful-authentication/142807/5 "2008-07-11T23:56:18Z")

</div>

On Jul 11, 2:04 pm, Kent F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> On my dev machine I switched from Apache to nginx and everything worked  
> very well. Unless you are using passenger I would suggest not using  
> Apache, but that’s just my opinion.
> 
> Hope this helps, if my host gives me any information I will be happy to  
> post it.

Interesting… thanks a lot for the update.

Jeff
