<?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="microsoft.identityServer.service" type="Microsoft.IdentityServer.Service.Configuration.ServiceConfiguration, Microsoft.IdentityServer.Service, Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> <section name="microsoft.identityServer" type="Microsoft.IdentityServer.Service.Configuration.IdentityServerConfiguration, Microsoft.IdentityServer.Service, Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/> <section name="microsoft.identityServer.proxy" type="Microsoft.IdentityServer.Service.Configuration.ProxyConfigurationSection, Microsoft.IdentityServer.Service, Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/> </configSections> <microsoft.identityServer serviceMode="Server"/> <microsoft.identityServer.proxy > <host name="" httpPort="80" httpsPort="443" /> <proxyTrust proxyTrustRenewPeriod="240" /> </microsoft.identityServer.proxy> <microsoft.identityServer.service> <policyStore connectionString="Data Source=\\.\pipe\mssql$microsoft##ssee\sql\query;Initial Catalog=AdfsConfiguration;Integrated Security=True" administrationUrl="net.tcp://localhost:1500/policy" /> <trustMonitoring enabled="true" /> </microsoft.identityServer.service> <system.diagnostics> <sources> <!-- To enable WIF tracing, change the switchValue below to desired trace level - Verbose, Information, Warning, Error, Critical --> <!-- Set TraceOutputOptions as comma separated value of the following; ProcessId ThreadId CallStack. Specify None to not include any of the optional data--> <!-- NOTE THAT THE CHANGES TO THIS SECTION REQUIRES SERVICE RESTART TO TAKE EFFECT --> <source name="Microsoft.IdentityModel" switchValue="Verbose"> <listeners> <!-- <add name="ADFSWifListener" traceOutputOptions="ProcessId,ThreadId" initializeData="Wif" type="Microsoft.IdentityServer.Diagnostics.ADFSTraceListener,Microsoft.IdentityServer,Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> --> <add name="ADFSWifListener" /> </listeners> </source> <!-- To enable WCF tracing, change the switchValue below to desired trace level - Verbose, Information, Warning, Error, Critical and uncomment the system.servicemodel section below --> <source name="System.ServiceModel" switchValue="Verbose" > <listeners> <!-- <add name="ADFSWcfListener" traceOutputOptions="ProcessId,ThreadId" initializeData="Wcf" type="Microsoft.IdentityServer.Diagnostics.ADFSTraceListener,Microsoft.IdentityServer,Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> --> <add name="ADFSWcfListener" /> </listeners> </source> <source name="System.ServiceModel.MessageLogging" switchValue="Verbose" > <listeners> <!-- <add name="ADFSWcfListener" traceOutputOptions="ProcessId,ThreadId" initializeData="Wcf" type="Microsoft.IdentityServer.Diagnostics.ADFSTraceListener,Microsoft.IdentityServer,Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> --> <add name="ADFSWcfListener" /> </listeners> </source> </sources> <!-- Added by Ben Cline - sharedListeners --> <sharedListeners> <add name="ADFSWcfListener" type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" initializeData="c:\temp\adfssvchost_servicemodel.svclog" traceOutputOptions="Timestamp"> <filter type="" /> </add> <add name="ADFSWifListener" type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" initializeData="c:\temp\adfssvchost_wif.svclog" traceOutputOptions="Timestamp"> <filter type="" /> </add> </sharedListeners> <trace autoflush="true" ></trace> </system.diagnostics> <system.serviceModel> <diagnostics> <messageLogging logEntireMessage="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true"> </messageLogging> </diagnostics> </system.serviceModel> <runtime> <gcServer enabled="true"/> </runtime> </configuration>
Some tips on Active Federation with ADFS 2.0
Introduction
At work I have been working on helping my company adopt ADFS 2.0 for a Single Sign-On initiative. I have been working on handling a WPF application’s federation with ADFS and needed to use active federation (by definition). I had been following along with Dominick Baier’s blog post at http://www.leastprivilege.com/WIFADFS2AndWCFndashPart5ServiceClientMoreFlexibilityWithWSTrustChannelFactory.aspx. Dominick’s sample seemed simple enough but there were quite a few ADFS things I had to figure out in order to make things work.
BTW, learning how WIF relates to ADFS has been quite challenging but I have found the following article to be very helpful: http://technet.microsoft.com/en-us/library/adfs2-federation-wif-application-step-by-step-guide(WS.10).aspx.
Issues
- So I downloaded the code for the post and tried running the ManualClient. This uses WSTrustChannelFactory to connect to ADFS. The base sample uses the following ADFS endpoint:
static string stsEndpoint = "https://<machine.domain>/adfs/services/trust/13/windowstransport";
The windowstransport ADFS endpoints are not enabled by default so you must enable them. When I first tried to enable the WS Trust 1.3 version it would enable but it would not allow me to enable the proxy for this. I am not sure why. Eventually I was able to get the WS Trust 1.3 endpoint enabled. So at first I switched over to using the WS Trust 2005 endpoint. I also had to change the trust version to TrustVersion.WSTrustFeb2005 in the code as well. Here is the updated code at this point:
static string stsEndpoint = "https://<machine.domain>/adfs/services/trust/2005/windowstransport"; static string svcEndpoint = "https://<machine.domain>/soapadfs/service.svc"; static void Main(string[] args) { var token = GetToken(); CallService(token); } private static SecurityToken GetToken() { var factory = new WSTrustChannelFactory( new WindowsWSTrustBinding(SecurityMode.Transport), stsEndpoint); factory.TrustVersion = TrustVersion.WSTrustFeb2005; var rst = new RequestSecurityToken { RequestType = RequestTypes.Issue, AppliesTo = new EndpointAddress(svcEndpoint), KeyType = KeyTypes.Symmetric }; var channel = factory.CreateChannel(); return channel.Issue(rst); }
- So then I ran the code and it got all the way to the last line of the method GetToken() and it gives me the following nearly meaningless message back (wrapped in a FaultException):
ID3082: The request scope is not valid or is unsupported.
I was not able to find very good information on this error but I eventually found out that one of the reasons that this can occur is if you have not setup a relying party trust in ADFS for your application.
- Like with much of active federation, there is a lot less documentation out there for active federation than for passive federation. Here are the steps I went through to create an ADFS relying party for an application that does not have a federation metadata document:
a. In the ADFS 2.0 MMC, click to create a Relying Party trust.
b. On the next page of the wizard, choose to “Enter data about the relying party manually”. Click Next
c. Enter a display name, click Next
d. Choose ADFS 2.0, click Next
e. For now, do not specify an encryption certificate, click Next,
f. Do not click to enable WS-Federation passive or Web-SSO. Both of these are browser-based options that do not apply to active federation. Click Next.
g. For the relying party trust identifier, enter the endpoint reference you are using to call over WS-Trust, so I entered: <a href=”https:///soapadfs/service.svc”>https://<machine.domain>/soapadfs/service.svc
h. Click to allow all to access the relying party, click Next.
i. Click Next to move on to the Claims Authorization Wizard.
j. I just specify a Windows username pass through at this point (see the link in my introduction for how to set this up). - So then I try to run the application again and I get another annoying error message:
ID3037: The specified request failed.
Unfortunately, this is a very general one. The solution I found was to go into the relying party trust and specify the encryption certificate.
- Then I can successfully get the GetToken method to work properly. I did also notice one other variation in the ADFS configuration that can lead to a weird error. If you disable a relying party trust and try to run the application again you get the following error:
MSIS3127: The specified request failed.
To resolve this, simply enable the relying party trust.
Conclusion
I have found that much of the work with ADFS goes by the principle, “no guts, no glory,” and I wish it were easier. There seem to be a large number of errors that you can receive without a lot of helpful information for helping you resolve them. Hopefully these error resolutions will help you and I will be sure to post any other workarounds I find as I get further down the road of implementing ADFS.
Thanks,
Passed 70-583 on Windows Azure
I just found out that I passed the Windows Azure beta exam! I took it back in November and have been waiting for such a long time to find out the results. I did hear that this exam will require re-certification every 2 years due to the constant rate of change of Azure.
For other people that have been waiting on their results, I checked the Prometric Candidate History and it changed from “Tested” to “Passed”. I had not yet gotten a “Congratulations on your new certification” email that usually comes. Apparently the results have been delayed for some reason.
— Update 2/18/2011 —
The exam is now showing on my Microsoft Transcript so the scoring process should be back to normal now.
Thanks,
.NET 4 WCF Certified!, Why I take Beta Exams
- It is one of the biggest challenges – there is basically only MSDN documentation, VS samples, and the exam outline to study from. There are usually not books, Transcenders, or specialized test taking materials available.
- If you are ever worried about all those brain dumps out there, take the exam before any brain dumps become available. If you pass before anyone could accuse you of cheating, there is practically no way to say you do not deserve the cert.
- You gain a credential few people can say they have for a period of time. It is a big cool factor too. 🙂
- It really tests your test taking endurance. If you are studying for a very long test like the CISSP, a Microsoft beta will help you extend your endurance. The betas usually take about 3 hours to do.
- You help improve the tests by providing valuable feedback on exam items, translation, and other details.
- Often times you earn a certification voucher good for another exam.
There are not that many times you can take beta exams so if you find an opportunity, go for it!. One way to find out about them is to go to the register page on Prometric, find a Microsoft exam with 71-* in the name, and then search the web for this exam to find the free code to get the test free. I love beta exams because they are the lowest cost opportunity to earn a certification. Thanks Microsoft for offering these!
New CodePlex Project – Custom WCF Bindings
WCF LOB SDK Talk at CNUG – June 16
CodeMastery Conference Recap
WCF LOB SDK Talk on May 26
Certifications in Reverse
- After studying all of the way to implement interfaces with WCF, it was much easier to understand what was going in WSE 3.
- Sometimes when working with WSE a few years ago I would scratch my head and wonder why it had to work that way or how round-about some of the exposed APIs were and how difficult it was to get my head around the concepts.
- I am very glad that the WCF bindings and BindingElements are organized so much better than the WSE SOAP Extension Types and Policy assertion types.
- If you do this unlikely certification path, of taking tests from most recent backwards, you can use this approach as a test strategy. 🙂
- During the 70-529 exam, I tried to figure out how the WSE APIs must have evolved in order to be the WCF APIs, and then I could answer the questions based on much more WCF experience. It was a funny endeavor.
BizTalk 2009 RFID – new WCF Endpoint Behavior
