views:

26

answers:

1

Is it possible to style the Windows Identity Foundation postback page?

This is the page that comes across as blank after you successfully login and the url is similar to https://sts.address.com/?wa=wsignin1.0&wtrealm=https....

+1  A: 

I don't know if this is a documented feature, but I will suggest the following as a jumping-off point:

If your code looks anything at all like mine, you have a line of code that looks like:

FederatedPassiveSecurityTokenServiceOperations.ProcessSignInResponse(responseMessage, HttpContext.Current.Response)

The second parameter to ProcesssignInResponse is an HttpResponse object. I tried, unsuccessfully, to find an answer to your question, by trying to pass in a custom HttpResponse message in order to capture the output so we can manipulate it however you like:

Dim myStringbuilder As New StringBuilder
Dim myStringWriter As New IO.StringWriter(myStringbuilder)
Dim myResponse As New Web.HttpResponse(myStringWriter)

If you pass in myResponse to ProcessSignInResponse, the following exception is thrown:

System.NullReferenceException: Object reference not set to an instance of an object. at System.Web.HttpResponse.End() at Microsoft.IdentityModel.Web.FederatedPassiveSecurityTokenServiceOperations.ProcessSignInResponse(SignInResponseMessage signInResponseMessage, HttpResponse httpResponse) at Logon_App.LCLoginBase.issueTokenAndRedirect(logonParamsStruct& logonParams) in C:\Logon App\Logon App\Code\LCLogin\LCLoginBase.vb:line xxx

Rice Flour Cookies
This does look like a very promising idea, I'll try try just writing to response directly myself first before handing it to WIF there.
Chris Marisic
Verified that this does indeed work, however it will create invalid HTML since anything written to the response will be outside of the html nodes that get inserted by WIF but browsers should reasonably be able to handle this anyway.
Chris Marisic