62,046
社区成员
发帖
与我相关
我的任务
分享
namespace ResourceServer
{
public partial class Startup
{
public void ConfigureAuth(IAppBuilder app)
{
app.UseOAuthBearerAuthentication(new Microsoft.Owin.Security.OAuth.OAuthBearerAuthenticationOptions());
}
}
}
namespace ResourceServer.Controllers
{
[EnableCors(origins: "*", headers: "*", methods: "*")]
[Authorize]
public class MeController : ApiController
{
public string Get()
{
return this.User.Identity.Name;
}
}
}