使用OWIN Cookies身份验证登录后,User.Identity.IsAuthenticated不是True-ASP.NET WebForms

时间:2018-08-20 03:03:26

标签: asp.net authentication owin

用户登录时遇到问题:

 private void Awake()
{
    if (Instance == null)
        Instance = this;
    else
        Destroy(gameObject);
    DontDestroyOnLoad(gameObject);
    interstitialAd = new InterstitialAd(InterstitialAdId);

    Showbanner(); // <------- Here
    requestAds();

    interstitialAd.LoadAd(request);
}

,然后在我的主页的Init中运行以下命令:

Dim manager = Context.GetOwinContext().GetUserManager(Of ApplicationUserManager)()
Dim signinManager = Context.GetOwinContext().GetUserManager(Of ApplicationSignInManager)()

'this session is for the whole issue of browser not getting the cookies'
HttpContext.Current.Session("RunSession") = "1"
Dim result = signinManager.PasswordSignIn(Email.Text, Password.Text, RememberMe.Checked, shouldLockout:=False)

由于某种原因,用户每次成功登录后都会不断重定向到登录屏幕。是否需要用其他东西代替Authenticated?

0 个答案:

没有答案