小编vik*_*ntx的帖子

MVC外部登录 - 如何跳过关联表单

我想跳过外部登录注册 - 关联表单 在此输入图像描述
我正在使用谷歌外部登录MVC5,如果您使用谷歌帐户登录,它会在第一次输入谷歌凭证后显示在屏幕上方.我只是想跳过这个屏幕.

上面的视图从中返回

        [AllowAnonymous]
        public async Task<ActionResult> ExternalLoginCallback(string returnUrl)
        {
            var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
            if (loginInfo == null)
            {
                return RedirectToAction("Login");
            }

            // Sign in the user with this external login provider if the user already has a login
            var user = await UserManager.FindAsync(loginInfo.Login);
            if (user != null)
            {
                await SignInAsync(user, isPersistent: false);
                return RedirectToLocal(returnUrl);
            }
            else
            {
                // If the user does not have an account, then prompt the user to create an account
                ViewBag.ReturnUrl = …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc-5 asp.net-identity

2
推荐指数
1
解决办法
728
查看次数

标签 统计

asp.net-identity ×1

asp.net-mvc-5 ×1

c# ×1