Пример #1
0
        private ActionResult ShowHomeRealmSelection(SignInRequestMessage message)
        {
            var idps = GetVisibleIdentityProviders();

            if (idps.Count() == 1)
            {
                var ip = idps.First();
                message.HomeRealm = ip.Name;
                Tracing.Verbose("Only one HRD option available: " + message.HomeRealm);
                if (ip.Type == IdentityProviderTypes.WSStar)
                {
                    return(RedirectToWSFedIdentityProvider(ip, message));
                }
                if (ip.Type == IdentityProviderTypes.OAuth2)
                {
                    return(RedirectToOAuth2IdentityProvider(ip, message));
                }
                throw new Exception("Invalid IdentityProviderType");
            }
            Tracing.Verbose("HRD selection screen displayed.");
            var vm = new HrdViewModel(message, idps);

            return(View("HRD", vm));
        }
Пример #2
0
 private ActionResult ShowHomeRealmSelection(SignInRequestMessage message)
 {
     var idps = GetVisibleIdentityProviders();
     if (idps.Count() == 1)
     {
         var ip = idps.First();
         message.HomeRealm = ip.Name;
         Tracing.Verbose("Only one HRD option available: " + message.HomeRealm);
         if (ip.Type == IdentityProviderTypes.WSStar)
         {
             return RedirectToWSFedIdentityProvider(ip, message);
         }
         if (ip.Type == IdentityProviderTypes.OAuth2)
         {
             return RedirectToOAuth2IdentityProvider(ip, message);
         }
         throw new Exception("Invalid IdentityProviderType");
     }
     Tracing.Verbose("HRD selection screen displayed.");
     var vm = new HrdViewModel(message, idps);
     return View("HRD", vm);
 }