-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding JwtBuilder and its dependencies/internals * Updating, refactoring tests * Bumping nuget version to 3.2.0-beta * Updating xml doc
- Loading branch information
1 parent
de16d6e
commit 3e62ccd
Showing
32 changed files
with
1,119 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
using System.ComponentModel; | ||
|
||
namespace JWT.Builder | ||
{ | ||
/// <summary> | ||
/// All public claims of a JWT specified by IANA, see https://www.iana.org/assignments/jwt/jwt.xhtml | ||
/// </summary> | ||
/// <remarks> | ||
/// Latest update: 31.10.2017 | ||
/// </remarks> | ||
public enum ClaimName | ||
{ | ||
[Description("iss")] | ||
Issuer, | ||
|
||
[Description("sub")] | ||
Subject, | ||
|
||
[Description("aud")] | ||
Audience, | ||
|
||
[Description("exp")] | ||
ExpirationTime, | ||
|
||
[Description("nbf")] | ||
NotBefore, | ||
|
||
[Description("iat")] | ||
IssuedAt, | ||
|
||
[Description("jti")] | ||
JwtId, | ||
|
||
[Description("name")] | ||
FullName, | ||
|
||
[Description("given_name")] | ||
GivenName, | ||
|
||
[Description("family_name")] | ||
FamilyName, | ||
|
||
[Description("middle_name")] | ||
MiddleName, | ||
|
||
[Description("nickname")] | ||
CasualName, | ||
|
||
[Description("preferred_username")] | ||
PreferredUsername, | ||
|
||
[Description("profile")] | ||
ProfilePageUrl, | ||
|
||
[Description("picture")] | ||
ProfilePictureUrl, | ||
|
||
[Description("website")] | ||
Website, | ||
|
||
[Description("email")] | ||
PreferredEmail, | ||
|
||
[Description("email_verified")] | ||
VerifiedEmail, | ||
|
||
[Description("gender")] | ||
Gender, | ||
|
||
[Description("birthdate")] | ||
Birthday, | ||
|
||
[Description("zoneinfo")] | ||
TimeZone, | ||
|
||
[Description("locale")] | ||
Locale, | ||
|
||
[Description("phone_number")] | ||
PreferredPhoneNumber, | ||
|
||
[Description("phone_number_verified")] | ||
VerifiedPhoneNumber, | ||
|
||
[Description("address")] | ||
Address, | ||
|
||
[Description("update_at")] | ||
UpdatedAt, | ||
|
||
[Description("azp")] | ||
AuthorizedParty, | ||
|
||
[Description("nonce")] | ||
Nonce, | ||
|
||
[Description("auth_time")] | ||
AuthenticationTime, | ||
|
||
[Description("at_hash")] | ||
AccessTokenHash, | ||
|
||
[Description("c_hash")] | ||
CodeHashValue, | ||
|
||
[Description("acr")] | ||
Acr, | ||
|
||
[Description("amr")] | ||
Amr, | ||
|
||
[Description("sub_jwk")] | ||
PublicKey, | ||
|
||
[Description("cnf")] | ||
Confirmation, | ||
|
||
[Description("sip_from_tag")] | ||
SipFromTag, | ||
|
||
[Description("sip_date")] | ||
SipDate, | ||
|
||
[Description("sip_callid")] | ||
SipCallId, | ||
|
||
[Description("sip_cseq_num")] | ||
SipCseqNumber, | ||
|
||
[Description("sip_via_branch")] | ||
SipViaBranch, | ||
|
||
[Description("orig")] | ||
OriginatingIdentityString, | ||
|
||
[Description("dest")] | ||
DestinationIdentityString, | ||
|
||
[Description("mky")] | ||
MediaKeyFingerprintString | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.ComponentModel; | ||
|
||
namespace JWT.Builder | ||
{ | ||
/// <summary> | ||
/// All predefined headers specified by RFC 7519, see https://tools.ietf.org/html/rfc7519 | ||
/// </summary> | ||
/// <remarks> | ||
/// Latest update: 31.10.2017 | ||
/// </remarks> | ||
public enum HeaderName | ||
{ | ||
[Description("typ")] | ||
Type, | ||
|
||
[Description("cty")] | ||
ContentType, | ||
|
||
[Description("alg")] | ||
Algorithm | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Globalization; | ||
|
||
namespace JWT.Builder.Internal | ||
{ | ||
internal static class DateTimeExtensions | ||
{ | ||
public static double GetSecondsSinceEpoch(this DateTime time) => Math.Round((time - JwtValidator.UnixEpoch).TotalSeconds); | ||
|
||
public static string GetSecondsSinceEpochAsString(this DateTime time) => GetSecondsSinceEpoch(time).ToString(CultureInfo.InvariantCulture); | ||
} | ||
} |
Oops, something went wrong.