/// <summary>
/// 使用DotNetOpenOAuth组件来模拟授权
/// </summary>
/// <returns></returns>
public ActionResult TestAuthorize()
{
var authServer = new AuthorizationServerDescription
{
AuthorizationEndpoint = new Uri("http://localhost:3335/OAuth/Authorize"),
TokenEndpoint = new Uri("http://localhost:3335/OAuth/Token")
};
var autoServerClient = new DotNetOpenAuth.OAuth2.WebServerClient(authServer, clientIdentifier: "fNm0EDIXbfuuDowUpAoq5GTEiywV8eg0TpiIVnV8", clientSecret: "clientSecret");
autoServerClient.RequestUserAuthorization(new string[] { "scope1" }, new Uri("http://localhost:3335/OAuth/GetAccessToken"));
return(new EmptyResult());
}