ClaimsFromJWT is a set of helper functions to take a already-validated JWT and turn it into a ClaimsIdentity populated with as many standardized claims as possible.
Install the NuGet package: Install-Package ClaimsFromJwt
, clone the repo, git clone git://github.com/advancedrei/claimsfromjwt.git
, or download the latest release.
Once the code has been installed, you can use the helper functions as needed. Deserialize the JWT into a Dictionary<string, object> and then pass that into JwtHelper.GetClaimsFromJwt().
You can add to the arrays that map names to claims, or add additional claim mapping using the same technique. If you make any changes, consider sending us a pull request so that all can take advantage.
Have a bug? Please create an issue here on GitHub that conforms with necolas's guidelines.
https://github.com/AdvancedREI/ClaimsFromJWT/issues
Keep up to date on announcements and more by following AdvancedREI on Twitter, @AdvancedREI.
Read more detailed announcements, discussions, and more on The AdvancedREI Dev Blog.
Robert McLaws
Copyright 2013-2014 Auth0, LLC. and AdvancedREI, LLC.
The MIT License (MIT)
Copyright (c) 2013-2014 Auth0, LLC. and AdvancedREI, LLC. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.