【发布时间】:2023-03-31 01:25:01
【问题描述】:
我正在尝试使用 Stormpath ID 站点授权创建 ASP.NET 应用程序。我创建了请求和响应操作并成功获得了帐户。
但是接下来呢?如何告诉应用用户已通过身份验证?
public async Task<RedirectResult> Callback(string jwtResponse)
{
var client = Request.GetStormpathClient();
var app = await client.GetApplicationAsync(appUrl);
var requestDescriptor = HttpRequests.NewRequestDescriptor()
.WithMethod("GET")
.WithUri("http://localhost:50084/Auth/Callback?jwtResponse=" + jwtResponse)
.Build();
var idSiteListener = app.NewIdSiteAsyncCallbackHandler(requestDescriptor);
var accountResult = await idSiteListener.GetAccountResultAsync();
var account = accountResult.GetAccountAsync().Result; //Account
//What I must do here to tell application that user is authenticated
return Redirect("/");
}
【问题讨论】:
标签: c# .net asp.net-mvc asp.net-mvc-4 stormpath