예제 #1
0
        public IActionResult Challenge(HttpContext context, IdentityProviderId providerId, string redirectUri)
        {
            if (_providers.AllAvailableIdentityProvidersForChoosing().Any(_ => _.Id == providerId))
            {
                var url = HttpUtility.UrlEncode(redirectUri);

                // TODO: Set some state properties here?
                return(new ChallengeResult(providerId.ToString(), new AuthenticationProperties {
                    RedirectUri = $"/signin/tenant?rd={url}",
                }));
            }
            else
            {
                return(_frontend.SpecifiedProviderDoesNotExist(context, providerId));
            }
        }
예제 #2
0
        public IActionResult Signin(string rd)
        {
            var providers = _resolver.AllAvailableIdentityProvidersForChoosing();

            switch (providers.Count())
            {
            case 0:
                return(_frontend.NoProvidersAvailable(HttpContext));

            case 1:
                return(_remoteAuthenticator.Challenge(HttpContext, providers.First().Id, rd));

            default:
                return(_frontend.ChooseProvider(HttpContext));
            }
        }
예제 #3
0
 public IEnumerable <IdentityProviderForChoosing> AllProviders() => _resolver.AllAvailableIdentityProvidersForChoosing();