I am new to Windows Identity Framework. My organization has multiple environments that make use of different 'authority' and 'endpoint' names. My application can detect the environment at runtime. I've looked through the WIF documentation and unable
to find anything that I can use to help me with this problem.
The example below works in my localhost environment:
In my development environment the same section needs to be:
<add key="ida:FederationMetadataLocation" value="https://test.login.mycompany.com/FederationMetadata/2007- 06/FederationMetadata1.xml" />
<add key="ida:Realm" value="https://localhost/webapp" />
<add key="ida:AudienceUri" value="https://localhost/webapp/" />
I also need to make similar changes to the AudienceURIs and the federationConfiguration.
<add key="ida:FederationMetadataLocation" value="https://dev.login.mycompany.com/FederationMetadata/2007-06/FederationMetadata1.xml" />
<add key="ida:Realm" value="https://dev.mycompany.com/webapp" />
<add key="ida:AudienceUri" value="https://dev.mycompany.com/webapp/" />
Here is the full localhost web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!--Added for Windows Identity Framework -->
<section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
/>
<section name="system.identityModel.services" type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
/>
<!--END: Added for Windows Identity Framework -->
</configSections>
<appSettings>
<!--Added for Windows Identity Framework -->
<add key="ida:FederationMetadataLocation" value="https://test.login.mycompany.com/FederationMetadata/2007-06/FederationMetadata1.xml" />
<add key="ida:Realm" value="https://localhost/webapp" />
<add key="ida:AudienceUri" value="https://localhost/webapp/" />
<!--END: Added for Windows Identity Framework -->
</appSettings>
<system.web>
...
</system.web>
<system.webServer>
<!--Added for Windows Identity Framework -->
<modules>
<add name="WSFederationAuthenticationModule" type="System.IdentityModel.Services.WSFederationAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
preCondition="managedHandler" />
<add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
preCondition="managedHandler" />
</modules>
<!--END: Added for Windows Identity Framework -->
</system.webServer>
<runtime>
<assemblyBinding ...
</assemblyBinding>
</runtime>
<!--Added for Windows Identity Framework -->
<system.identityModel>
<identityConfiguration>
<audienceUris>
<add value="https://localhost/webapp" />
<add value="https://localhost/webapp/FederationResult/" />
</audienceUris>
<securityTokenHandlers>
...
</securityTokenHandlers>
<certificateValidation certificateValidationMode="None" />
<issuerNameRegistry type="System.IdentityModel.Tokens.ValidatingIssuerNameRegistry, System.IdentityModel.Tokens.ValidatingIssuerNameRegistry">
<authority name="http://test.login.mycompany.com/adfs/services/trust">
<keys>
<add thumbprint="123320493" />
</keys>
<validIssuers>
<add name="http://test.login.mycompany.com/adfs/services/trust" />
</validIssuers>
</authority>
</issuerNameRegistry>
</identityConfiguration>
</system.identityModel>
<system.identityModel.services>
<federationConfiguration>
<wsFederation
issuer="https://test.login.mycompany.com/adfs/ls/"
realm="https://localhost/webapp/"
reply="https://localhost/webapp/"
passiveRedirectEnabled="true"
requireHttps="true" />
<cookieHandler name="LocalFedAuthRounding" requireSsl="true" />
</federationConfiguration>
</system.identityModel.services>
<!--Added for Windows Identity Framework -->
</configuration>
Does the WIF provide methods to do this? I've looked through the documents and can't figure out how to make these changes.
Thanks,
Matt