# Activeresource

**URL:** <https://www.ruby-forum.com/t/activeresource/144382>\
**Category:** Rails\
**Created:** [July 29, 2008, 7:17am UTC](https://www.ruby-forum.com/t/activeresource/144382 "2008-07-29T07:17:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bishal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a698b9/32.png) [@bishal](https://www.ruby-forum.com/u/bishal)\
**Post date:** [July 29, 2008, 7:17am UTC](https://www.ruby-forum.com/t/activeresource/144382/1 "2008-07-29T07:17:17Z")

</div>

Can somebody explain how can we go throught the process of restful  
authentication via activeresource. I have gone through it but the  
concept is still vague for me.

---

<div class="post-metadata">

**Author:** ![bishal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a698b9/32.png) [@bishal](https://www.ruby-forum.com/u/bishal)\
**Post date:** [July 29, 2008, 2:14pm UTC](https://www.ruby-forum.com/t/activeresource/144382/2 "2008-07-29T14:14:22Z")

</div>

Use HTTP Basic authentication on the server providing the  
ActiveResources. You can set the credentials for accessing via HTTP  
Basic in ActiveResource. Ideally you’ll probably create a ‘base’  
resource that has the credentials and site info and then inherit from  
that for the rest of your ARes classes.

HTH,  
AndyV

On Jul 29, 1:17 am, Bishal A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![bishal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a698b9/32.png) [@bishal](https://www.ruby-forum.com/u/bishal)\
**Post date:** [July 30, 2008, 2:48am UTC](https://www.ruby-forum.com/t/activeresource/144382/3 "2008-07-30T02:48:35Z")

</div>

Thanks for the response.

I have been able to do http authentication by crateing a base resource  
but my requirements are such that I cannot make a base resource  
containing the site crediantials rather I have to dynamically assign the  
crediantials according to the users authentication…Can you suggest  
me how to do that ? I have to access the server resources by a remote  
client using activeresource but the remote client too has a client which  
provides crediantials to remote client instead to the server now If i  
create a static base resource in the remote client, I can only deal with  
one user i guess but condition demands me to make this process dynamic ?  
anu suggestions will be helpful.

AndyV wrote:

> Use HTTP Basic authentication on the server providing the  
> ActiveResources. You can set the credentials for accessing via HTTP  
> Basic in ActiveResource. Ideally you’ll probably create a ‘base’  
> resource that has the credentials and site info and then inherit from  
> that for the rest of your ARes classes.
> 
> HTH,  
> AndyV
> 
> On Jul 29, 1:17ï¿½am, Bishal A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![bishal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a698b9/32.png) [@bishal](https://www.ruby-forum.com/u/bishal)\
**Post date:** [July 30, 2008, 11:33am UTC](https://www.ruby-forum.com/t/activeresource/144382/4 "2008-07-30T11:33:50Z")

</div>

Bishal A. wrote:

> I have been able to do http authentication by crateing a base resource  
> but my requirements are such that I cannot make a base resource  
> containing the site crediantials rather I have to dynamically assign the  
> crediantials according to the users authentication…Can you suggest  
> me how to do that ? I have to access the server resources by a remote  
> client using activeresource but the remote client too has a client which  
> provides crediantials to remote client instead to the server now If i  
> create a static base resource in the remote client, I can only deal with  
> one user i guess but condition demands me to make this process dynamic ?  
> anu suggestions will be helpful.

If you use restful\_authentication then you can authenticate against any  
number of different users. Implement a role-based system on top of it  
with the appropriate filters in the RESTful controllers, and you’re set  
to go.

–  
Roderick van Domburg

> **[De domeinnaam Nedforce.nl is te koop.](http://www.nedforce.nl)**
>
> Deze mooie domeinnaam kan al over een paar minuten van jou zijn. Betalen gaat eenvoudig en vertrouwd via iDEAL. Direct na de betaling ontvang je de verhuiscode per e-mail en kun je aan de slag.
