Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Developing Authentication and Roles thinking about API

Reply
Thread Tools

Developing Authentication and Roles thinking about API

 
 
Giammarco
Guest
Posts: n/a
 
      08-25-2005
Hi all,

I'm developing an ASP.NET website and thinking about releasing the API
through webservices in a couple of months (like flickr.com let's say).

Most of the website functionality is restricted to authenticated users.
Users are classified in different roles, and different roles can take
different actions.

E.g. Guest can call a function to delete one of his articles, but
cannot call a function that can delete any article (which can be called
by an Administrator).

I would like to ask how would you handle user authentication and roles,
considering that I have to release the API?

The following is an example of the parameters I need to pass to a
"DeleteArticle" function called from a asp.net page that is accessible
only to authenticated users.

public bool DeleteArticle(articleID, UserID)
{
// delete article
}

The same function called from the API, could look like this if
authentication and roles are not planned with the webservices in mind.

public bool DeleteArticle(articleID, userID, userPassword)
{
// check username and password and authenticate
// check if user can delete article
// delete article
}

Thanks in advance,
Giammarco

 
Reply With Quote
 
 
 
 
=?Utf-8?B?TGVlIENoYXBtYW4=?=
Guest
Posts: n/a
 
      08-25-2005

Read up on "code access security". Rather than accepting authentication and
authorization information via your API, demand appropriate permissions inside
your implementation and let the Framework implement the security for you.

"Giammarco" wrote:

> Hi all,
>
> I'm developing an ASP.NET website and thinking about releasing the API
> through webservices in a couple of months (like flickr.com let's say).
>
> Most of the website functionality is restricted to authenticated users.
> Users are classified in different roles, and different roles can take
> different actions.
>
> E.g. Guest can call a function to delete one of his articles, but
> cannot call a function that can delete any article (which can be called
> by an Administrator).
>
> I would like to ask how would you handle user authentication and roles,
> considering that I have to release the API?
>
> The following is an example of the parameters I need to pass to a
> "DeleteArticle" function called from a asp.net page that is accessible
> only to authenticated users.
>
> public bool DeleteArticle(articleID, UserID)
> {
> // delete article
> }
>
> The same function called from the API, could look like this if
> authentication and roles are not planned with the webservices in mind.
>
> public bool DeleteArticle(articleID, userID, userPassword)
> {
> // check username and password and authenticate
> // check if user can delete article
> // delete article
> }
>
> Thanks in advance,
> Giammarco
>
>

 
Reply With Quote
 
 
 
 
Giammarco
Guest
Posts: n/a
 
      08-25-2005
Thanks Lee,

Giammarco

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linear thinking vs essential thinking optimistx Javascript 4 10-29-2009 04:19 PM
Membership API Controls - Manage Roles and Users Steven Nagy ASP .Net 3 04-12-2007 09:49 PM
Forms Based Authentication and AD and Roles and Security Trimming! Eric ASP .Net Security 0 11-01-2006 03:24 PM
Application level roles + Item level roles... how to do it? Jéjé ASP .Net Security 0 09-26-2005 11:06 PM
WHY?!? Why am i thinking i need an SLR, and thinking of going 35mm? Steven C \(Doktersteve\) Digital Photography 13 02-13-2004 08:42 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57