c# - Programatically Configuring federatedAuthentication element in microsoft.identityModel on asp.net application -
I am trying to generate the following configuration contained in Microsoft in the program. So far I have not been able to configure it successfully. I tried to install the following in Application_Start but when I try to insert in I get an error message "ID5002: Issuer property on FederatedPassiveSignIn control to find out an STS endpoint that can process WS Should be set-to-effect passive protocol message. " I am absolutely sure that I am not properly configuring the federal authority, and I am not sure that one thing to properly configure it is that I have noticed that When I set a breakpoint to start a request, and inspect the federal authority. VSFederationAuthenticationModule I do not see the properties on the Web when the value.config does not exist Manage code from all code, and I'm just using App Settings for RP and STS server name etc. It should work for you set up btw - This is a trust party (.sts setup is easy) is set up & lt; federatedAuthentication & gt; & Lt; WsFederation passiveRedirectEnabled = "false" is required https = "true" Issuer = "https://IssuedByFoo.com" realm = "http://foo.com/" /> & Lt; CookieHandler requires SSLL = "true" path = "/" /> & Lt; / federatedAuthentication & gt;
Federal Authorization. The authorization authority module. Reel = "http://foo.com/"; FederatedAuthentication.WSFederationAuthenticationModule.Issuer = "https://IssuedByFoo.com"; Federal Authority. Protection Authority module. PasswiredDisabled = Valid; Federal certification SFIFR Efficiency Module Expected HTMLPS = true; FederatedAuthentication.SessionAuthenticationModule.CookieHandler.RequireSsl = true; FederatedAuthentication.SessionAuthenticationModule.CookieHandler.Path = "/";
protected zero Application_Start () {federatedAuthentication.FederationConfigurationCreated + = FederatedAuthentication_FederationConfigurationCreated; } Private Static Zero FederatedAuthentication_FederationConfigurationCreated (Object Sender, FederationConfigurationCreatedEventArgsE) {// appSettings ... from the static allowedAudience = "http: // audience1 / user / receive"; const string rpRealm = "http: // audience1 /"; Const String Domain = ""; const bool requires SSL = false; Constant String Issuer = "http: // sts / Token"; String String certificateThumbprint = "mythumbprint"; Constants String authCookieName = "StsAuth"; var federationConfiguration = New FederationConfiguration (); federationConfiguration.IdentityConfiguration.AudienceRestriction.AllowedAudienceUris.Add (New Ur issuingAuthority = new issuers authority (internal STS); issuing authority, thumbprint, add (certificate print); issuing authority, freezes (internal STS); var issuing authority V = new list and issuer; authorization; gt; issuingAuthority; var validatingIssuerNameRegistry = new validatingIssuerNameRegistry {issuingAuthorities = issuingAuthorities}; federation configuration.ISIDERRegistry = validationISRRIrgistry; federation configuration. IDENTITY configuration.Certificate validityMode = X509 certification validationMode.No; var Chunky Cookie Handler = New Child Handbook {Essential SSL = False, Name = authCookieName, Domain = Omen, Persistent Ssn Lifetime = new Taimspen (0, 0, 30, 0)}; Federation configuration. Cookheldler = Chuck Chuckhalander; Federation configuration. Constituent Configuration ISugar = issuer; Federation configuration. Federation Configuration Reel = rpplum; Federation Configuration .fedadation configuration. Required HTPS = Essential SSL; E. Fidderction Configuration = Federation Configuration;
Comments
Post a Comment