问题描述
从chrome的7月14日更新开始,该更新已经推出了相同的网站功能...从chrome发行此版本后,我的网站未使用0365帐户选项登录。
如果我为“没有相同站点的Cookie应该是安全的”禁用了chrome://标记,那么它将起作用。
如何在我的owin cookie的启动代码中实现上述标志相关的更改?
我有下面的代码,我已经设置了samesite.none,但是不起作用。
Public Sub Configuration(app As IAppBuilder)
Try
If Not (ConfigurationManager.AppSettings("MicrosoftRedirectUri") Is nothing) Then redirectUri = ConfigurationManager.AppSettings("MicrosoftRedirectUri")
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType)
app.UseCookieAuthentication(New CookieAuthenticationoptions With {
.CookieSameSite = Microsoft.Owin.SameSiteMode.None
})
app.USEOpenIdConnectAuthentication(New OpenIdConnectAuthenticationoptions With {
.ClientId = clientId,.Authority = authority,.RedirectUri = redirectUri,.PostlogoutRedirectUri = redirectUri + "/MicrosoftLoggedout.aspx",.Scope = "openid profile email offline_access",.ResponseType = OpenIdConnectResponseType.IdTokenToken,.TokenValidationParameters = New TokenValidationParameters() With {
.ValidateIssuer = False
},.Notifications = New OpenIdConnectAuthenticationNotifications() With {
.AuthenticationFailed = Function(context)
context.HandleResponse()
context.Response.Redirect("/?errormessage=" & context.Exception.Message)
Return System.Threading.Tasks.Task.Fromresult(0)
End Function,.SecurityTokenValidated = Function(n)
Dim idtoken As String = n.ProtocolMessage.IdToken
If Not String.IsNullOrEmpty(idtoken) Then
n.AuthenticationTicket.Identity.AddClaim(New Claim("id_token",idtoken))
End If
Dim token = n.ProtocolMessage.Accesstoken
If Not String.IsNullOrEmpty(token) Then
n.AuthenticationTicket.Identity.AddClaim(New Claim("access_token",token))
End If
Return Task.Fromresult(0)
End Function
}
})
app.UseStageMarker(Pipelinestage.Authenticate)
Catch ex As Exception
End Try
End Sub
End Class
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)