12

I want to add OAuth authorization for my RESTful web API, which build on ASP.NET Web API. Preferably to be able to use [Authorize] attribute. Could you give me examples of creating own service provider or using some library?

2
  • 1
    I am not sure why you should ever want to do that. OAuth and OpenID protocols use several request with user interaction and rest is basically a single machine based request/response. You can combine the ASP.NET membership provider with a library like DotNetopenAuth and use the ASP.NET session mechanism for authentication. Commented Apr 8, 2012 at 13:49
  • 1
    @AndrevanHeerwaarde could you give an example of "combine the ASP.NET membership provider with a library like DotNetopenAuth"? I found only this example - ASP.NET MVC 2 OpenID web site. But as I understand this template uses WCF web service as OAuth provider and a lot of unnecessary code for OpenID (which I do not need). I would like to see an example of using ASP.NET WebAPI with DotNetopenAuth. Commented Apr 12, 2012 at 12:25

1 Answer 1

2

FWIW, this is planned for the next drop (which will be a release candidate). So if you can wait until then, you'll get this out of the box with demos/samples.

http://aspnetwebstack.codeplex.com/wikipage?title=Roadmap

Since the code is open source, I'd suggest following the codeplex project to see how it progresses. This way you can leverage what gets built as it happens without having to wait for the official RC.

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

2 Comments

It looks like the RC is out - do you know if this was part of it? I still see it on the roadmap (which doesn't seem to be up to date).
I haven't checked the samples personally but they may be updated. See this post for context: aspnetwebstack.codeplex.com/discussions/351122.

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.