Using the open source version JWT Token Handler.  My fork is https://github.com/richardschneider/azure-activedirectory-identitymodel-extensions-for-dotnet
Some documentation for the OpenIdConnect namespace.