public IActionResult ExternalLogin(string externalProvider, string returnUrl)
        {
            returnUrl = returnUrl ?? Url.Action("Index", "Home");

            // start challenge and roundtrip the return URL and
            var redirectUrl = Url.Action("ExternalLoginCallback", "Account", new { ReturnUrl = returnUrl });

            var properties = m_signInManager.ConfigureExternalAuthenticationProperties(externalProvider, redirectUrl);

            properties.SetParameter("returnUrl", returnUrl);

            return(Challenge(properties, externalProvider));
        }
示例#2
0
        public IActionResult AddExternalLogin(string externalProvider, string returnUrl)
        {
            returnUrl = returnUrl ?? GetDefaultRedirectUrlForUser(int.Parse(User.Identity.GetSubjectId()));

            // start challenge and roundtrip the return URL and
            var redirectUrl = Url.Action("LinkLoginCallback", new { ReturnUrl = returnUrl });

            var properties = m_signInManager.ConfigureExternalAuthenticationProperties(
                externalProvider, redirectUrl,
                User.Identity.GetSubjectId()
                );

            return(Challenge(properties, externalProvider));
        }