Inside the package, there is a class called JwtSecurityTokenHandler , which comes from System.IdentityModel.Tokens.SecurityTokenHandler . In WIF, this is the main class for deserializing and serializing security tokens.
The class has a ReadToken(String) method that will take your base64 encoded JWT string and return a SecurityToken that represents the JWT.
SecurityTokenHandler also has a ValidateToken(SecurityToken) method that takes your SecurityToken and creates ReadOnlyCollection<ClaimsIdentity> . Typically for a JWT, this will contain a single ClaimsIdentity object that has a set of claims representing the properties of the original JWT.
JwtSecurityTokenHandler defines some additional overloads for the ValidateToken , in particular, it has the ClaimsPrincipal ValidateToken(JwtSecurityToken, TokenValidationParameters) . The TokenValidationParameters argument allows TokenValidationParameters to specify a token signing certificate (in the form of an X509SecurityTokens list). It also has an overload that accepts the JWT as a string , not a SecurityToken .
The code for this is quite complicated, but it can be found in the Global.asax.cx ( TokenValidationHandler class) code in the developerโs example, called "ADAL - Native App to REST service - ACS authentication through the browser dialog" located in
http://code.msdn.microsoft.com/AAL-Native-App-to-REST-de57f2cc
As an alternative, the JwtSecurityToken class has additional methods that do not apply to the SecurityToken base class, for example, the Claims property, which receives the claims contained in it without passing through the ClaimsIdentity collection. It also has a Payload property, which returns a JwtPayload object that allows you to get the original JSON of the token. It depends on your scenario that suits him best.
The general (i.e. not JWT-specific) documentation for the SecurityTokenHandler class is in
http://msdn.microsoft.com/en-us/library/system.identitymodel.tokens.securitytokenhandler.aspx
Depending on your application, you can configure the JWT handler in the WIF pipeline just like any other handler.
There are 3 samples used in different types of applications in
http://code.msdn.microsoft.com/site/search?f%5B0%5D.Type=SearchText&f%5B0%5D.Value=aal&f%5B1%5D.Type=User&f%5B1%5D.Value=Azure% 20AD% 20Developer% 20Experience% 20Team & f% 5B1% 5D.Text = Azure% 20AD% 20Developer% 20Experience% 20Team
Probably one of them will suit your needs or, at least, will adapt to them.