【发布时间】:2016-01-21 16:50:23
【问题描述】:
在带有 Identity Framework 2 的 ASP.NET 4 中,我可以在 redirectUri 中附加我自己的参数,例如 Google 用来限制登录到这样的域的“hd”参数:
var googleAuthOptions = new GoogleOAuth2AuthenticationOptions
{
ClientId = "redacted",
ClientSecret = "redacted",
Provider = new CustomGoogleProvider
{
OnApplyRedirect = context =>
{
var redirect = context.RedirectUri;
redirect += "&hd=contoso.com";
context.Response.Redirect(redirect);
}
}
};
app.UseGoogleAuthentication(googleAuthOptions);
但我无法找到有关如何使用带有 Identity Framework 3 的新 ASP.NET Core 1 执行相同操作的文档。
【问题讨论】:
标签: c# asp.net asp.net-identity google-oauth asp.net-core