Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

auth10/SimpleWebToken

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleWebToken

The minimum library to handle SimpleWebTokens

Credits to @kzu and @zahmed

Usage

Install-Package Auth10.SimpleWebToken

And the simplest validation is

var validator = new SimpleWebTokenValidator 
{
	SharedKeyBase64 = "...base64key..."	
}
var swt = validator.ValidateToken(token); // this will throw an exception if the token is invalid
// if valid you can access claims with: swt.Claims

If you want to validate audience and issuer. Setting the properties will instruct the library to validate them.

var validator = new SimpleWebTokenValidator 
{
	SharedKeyBase64 = "...base64key...",
	Issuer = "issuer-identifier"  // e.g.: https://auth10.accesscontrol.windows.net	
}
validator.AllowedAudiences.Add(new Uri("http://server/myapi"));
var swt = validator.ValidateToken(token); // this will throw an exception if the token is invalid

About

The minimum library to handle SimpleWebTokens

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.