Category Archives: ASP.NET

Using Information Cards in ASMX Web Services

As I wrote here – an Information Card token is just a string. This means that (with the help of some extra plumbing) you can seamlessly integrate cards into “legacy” technologies. Here’s a sample walkthrough for ASMX web services. To … Continue reading

Posted in ASP.NET, IdentityModel | Leave a comment

Using IdentityModel: Some Samples

Here are some typical usage scenario of IdentityPrincipal in ASP.NET. Simple IsInRole calls (checks for a status claim with a value of ‘Gold’): HttpContext.Current.User.IsInRole(“Gold”);   Retrieving the OrderHistory claim: IdentityPrincipal ip = IdentityPrincipal.Current;Claim orderHistory = ip.ClaimSets.FindClaim(  Constants.OrderHistoryClaimType,   Constants.ApplicationIssuerIdentityClaim); var … Continue reading

Posted in ASP.NET, IdentityModel, WCF | Leave a comment

Using IdentityModel: Adding ASP.NET Support Part 2 (Claims Manager)

The last step for integrating claims into ASP.NET is to write a module that loads authorization policies, creates an AuthorizationContext and persists that on Context.User/Thread.CurrentPrincipal. My module has this simple configuration section: <claimsManager enabled=“true“               addAuthenticationClaims=“true“               roleClaimType=“urn:leastprivilege/claims/customers/status“>  <authorizationPolicies>    <policy type=“LeastPrivilege.CustomerIdAuthorizationPolicy, App_Code“ … Continue reading

Posted in ASP.NET, IdentityModel | Leave a comment

Using IdentityModel: Adding ASP.NET Support Part 1 (Authentication based Claims)

Adding claims support to ASP.NET is a perfect candidate for an HTTP module. As a reminiscence to RoleManager, I called mine ClaimsManager. The job of the claims manager is this: Creating claims based on the technical authentication details (Windows, Forms, … Continue reading

Posted in ASP.NET, IdentityModel | Leave a comment

Using IdentityModel: IdentityPrincipal

Since V1 of .NET there is a “slot” to store authorization information about the current user: Thread.CurrentPrincipal. This data gets propagated to newly created threads and is deeply integrated into other application frameworks like ASP.NET. To integrate claims into ASP.NET … Continue reading

Posted in ASP.NET, IdentityModel, WCF | Leave a comment

Using IdentityModel: Adding Claims Support to ASP.NET (Spoiler)

Many people asked me how to use claims based authorization in ASP.NET. While I have it working here on my machine (hey – it works on my machine!), I still need to polish the bits before I can release them. … Continue reading

Posted in ASP.NET, IdentityModel | Leave a comment

Using IdentityModel: Claims

A claim is a piece of information that you want to associate with an entity (usually a user) in your system. Commonly used claims are e.g. the name of a user or his roles. The usual course of events is, … Continue reading

Posted in ASP.NET, IdentityModel, WCF | Leave a comment

Extending IIS 7 Configuration

If you want to add your own configuration sections (e.g. for this or this) to IIS 7 you have to write a schema file and dop it into the schema folder. From that point on it can be picked up … Continue reading

Posted in ASP.NET | Leave a comment

UserName SupportingToken in WCF

There has been some mentioning of supporting tokens recently (here and here). Supporting tokens allow adding additional tokens to a SOAP security header – at least one token (usually the primary token) must be capable of providing the necessary key … Continue reading

Posted in ASP.NET, WCF | 5 Comments

ASP.NET Internals Spelunking II

Suppose you want to step through one of the built-in HttpModules in ASP.NET. This doesn’t work by traversing the callstack. There is another little “trick” to get this working: Go to Debug/New Breakpoint/Break at Function Enter the function name, e.g. … Continue reading

Posted in ASP.NET | Leave a comment