Esempio n. 1
0
        //[ChildActionOnly]
        public ActionResult IdentityProvidersWithClientSideCode()
        {
            WSFederationAuthenticationModule fam = FederatedAuthentication.WSFederationAuthenticationModule;
            HrdRequest request = new HrdRequest(fam.Issuer, fam.Realm, context: Request.Url.AbsoluteUri);

            return PartialView("_IdentityProvidersWithClientSideCode", request);
        }
Esempio n. 2
0
        public ActionResult IdentityProvidersWithServerSideCode()
        {
            WSFederationAuthenticationModule fam = FederatedAuthentication.WSFederationAuthenticationModule;
            HrdRequest request = new HrdRequest(fam.Issuer, fam.Realm, context: Request.Url.AbsoluteUri);

            IEnumerable<HrdIdentityProvider> hrdIdentityProviders = hrdClient.GetHrdResponse(request);

            return PartialView("_IdentityProvidersWithServerSideCode", hrdIdentityProviders);
        }
Esempio n. 3
0
        public virtual IEnumerable<HrdIdentityProvider> GetHrdResponse(HrdRequest request)
        {
            WebClient client = new WebClient();
            client.Encoding = Encoding.UTF8;

            string response = client.DownloadString(request.GetUrlWithQueryString());

            JavaScriptSerializer serializer = new JavaScriptSerializer();
            return serializer.Deserialize<List<HrdIdentityProvider>>(response);
        }
Esempio n. 4
0
        public virtual IEnumerable <HrdIdentityProvider> GetHrdResponse(HrdRequest request)
        {
            WebClient client = new WebClient();

            client.Encoding = Encoding.UTF8;

            string response = client.DownloadString(request.GetUrlWithQueryString());

            JavaScriptSerializer serializer = new JavaScriptSerializer();

            return(serializer.Deserialize <List <HrdIdentityProvider> >(response));
        }