how to create OAuth Authorization Server
e.g.
var OAuthServerOptions = new OAuthAuthorizationServerOptions
{
AllowInsecureHttp = true,
TokenEndpointPath = new PathString("/token"),
AccessTokenExpireTimeSpan = TimeSpan.FromMinutes(30),
Provider = container.Resolve
how to do this in asp.net 5 (vnext).
references:
http://www.asp.net/aspnet/overview/owin-and-katana/owin-oauth-20-authorization-server http://bitoftech.net/2014/06/01/token-based-authentication-asp-net-web-api-2-owin-asp-net-identity/ http://aspnetguru.com/adding-authentication-to-asp-net-web-api/ http://blogs.msdn.com/b/webdev/archive/2013/09/20/understanding-security-features-in-spa-template.aspx http://odetocode.com/blogs/scott/archive/2015/01/15/using-json-web-tokens-with-katana-and-webapi.aspx
You can't, the OAuth2 authorization server has not been (and won't be) ported to ASP.NET 5: http://stackoverflow.com/questions/29055477/oauth-authorization-service-in-asp-net-mvc-6
IdentityServer3 works fine on ASP.NET 5 (but not on the CoreClr)
https://github.com/IdentityServer/IdentityServer3.Samples/tree/master/source/AspNet5Host
@leastprivilege This line of code is busted:
https://github.com/IdentityServer/IdentityServer3.Samples/blob/master/source/AspNet5Host/src/IdentityServer3/Startup.cs#L21
It should be using IApplicationEnvironment
thanks! Will update.
For anyone still looking for the original OAuth Authorization Server in ASP.NET 5, I have ported the code and the original sample here: https://github.com/XacronDevelopment/oauth-aspnet
The port includes backwards compatibility to allow ASP.NET 4.x resource servers to read the access tokens created by the authorization server.
The nuget packages are here: https://www.nuget.org/packages/OAuth.AspNet.AuthServer https://www.nuget.org/packages/OAuth.AspNet.Tokens https://www.nuget.org/packages/OAuth.Owin.Tokens
@Xacron thanks, will try.