请问您是怎么处理的呢?我随便写了几句代码,服务端是有反应了,不过提示是 he callback URL (http://localhost:29638/Account/ExternalLogin?ReturnUrl=) is not allowed for this client.client的代码: public void RequestAuthentication(HttpContextBase context, Uri returnUrl) { Client = new WebServerClient(authServerDescription, "123", "test456"); // Check to see if we're receiving a end user authorization response. var authorization = Client.ProcessUserAuthorization(context.Request); if (authorization != null) { // We are receiving an authorization response. Store it and associate it with this user. Authorization = authorization; context.Response.Redirect(context.Request.Path); // get rid of the /?code= parameter } else { Client.RequestUserAuthorization(); } if (Authorization != null) { if (Authorization.AccessTokenExpirationUtc.HasValue) { TimeSpan timeLeft = Authorization.AccessTokenExpirationUtc.Value - DateTime.UtcNow; } } }
请问您是怎么处理的呢?我随便写了几句代码,服务端是有反应了,不过提示是
he callback URL (http://localhost:29638/Account/ExternalLogin?ReturnUrl=) is not allowed for this client.client的代码:
public void RequestAuthentication(HttpContextBase context, Uri returnUrl)
{
Client = new WebServerClient(authServerDescription, "123", "test456");
// Check to see if we're receiving a end user authorization response.
var authorization = Client.ProcessUserAuthorization(context.Request);
if (authorization != null)
{
// We are receiving an authorization response. Store it and associate it with this user.
Authorization = authorization; context.Response.Redirect(context.Request.Path); // get rid of the /?code= parameter
}
else
{
Client.RequestUserAuthorization();
} if (Authorization != null)
{ if (Authorization.AccessTokenExpirationUtc.HasValue)
{
TimeSpan timeLeft = Authorization.AccessTokenExpirationUtc.Value - DateTime.UtcNow; }
}
}