3

I'm looking to restrict access to controllers/actions that represent my website's api. Only registered users who meet a certain criteria (pay accounts, not free trials) will be able to use the api. The website currently supports forms authentication with users logging in with a username/password combination or via open id.

How would have the users authenticate with the api? The api will initially be used by mobile applications (iphone, droid). My main concern is open id support with mobile apps.

My thoughts on available options are:

  1. Support both Username/password & open id - Not sure how well iphone/droid apps can support openid authentication.
  2. Only support Username/password - force OpenId users to create un/pwd for api - Bad UX for OpenId users
  3. Use an api token - This worries me for two reasons:
    1. Users would have to manually type in their api key which sucks from a UX point of view
    2. They could easily distribute/share their api key with other users and that would ruin reports/metrics.
  4. Something else that I missed?

3 Answers 3

0

We use #1 - open id or username/password. I don't see how this is specific to asp.net or asp.net mvc though ... it seems like more of an architectural question.

Sign up to request clarification or add additional context in comments.

1 Comment

So iphone and droid apps have no problems authenticating to webservices using openid?
0

I think it depends on how your creating your services API (REST/JSON, XML, WCF, etc..) but here are some links that will help:

ASP.NET MVC - HTTP Authentication Prompt

http://code.google.com/p/dotnetopenid/

Comments

-1

I found that token based authentication worked the best.

OAuth 2 is an attractive alternative that would be supported by all mobile devices and a site that already allows multiple forms of authentication.

DotNetOpenAuth offers a .net library for working with OAuth2, among other authentication technologies.

1 Comment

Link provided doesn't offer implementation for .net, as the OP asked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.