OLT.Identity.ClaimTypeNames 0.1.0

Prefix Reserved
dotnet add package OLT.Identity.ClaimTypeNames --version 0.1.0                
NuGet\Install-Package OLT.Identity.ClaimTypeNames -Version 0.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OLT.Identity.ClaimTypeNames" Version="0.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OLT.Identity.ClaimTypeNames --version 0.1.0                
#r "nuget: OLT.Identity.ClaimTypeNames, 0.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install OLT.Identity.ClaimTypeNames as a Cake Addin
#addin nuget:?package=OLT.Identity.ClaimTypeNames&version=0.1.0

// Install OLT.Identity.ClaimTypeNames as a Cake Tool
#tool nuget:?package=OLT.Identity.ClaimTypeNames&version=0.1.0                

OLT.Identity.ClaimTypeNames

Provides a comprehensive list of OpenID Connect and JWT claim types as constants. This library includes registered claims from various sources such as OpenID Connect Core, RFC 7519, and other widely-used identity frameworks. It simplifies the process of working with standard claims in .NET applications by offering a centralized and consistent set of claim type definitions.

Nuget CI

Features

  • Comprehensive list of OpenID Connect and JWT claim types.
  • Centralized and consistent set of claim type definitions.
  • Simplifies the process of working with standard claims in .NET applications.

Installation

You can install the package via NuGet:

dotnet add package OLT.Identity.ClaimTypeNames

Usage

Here's a basic example of how to use the ClaimTypeNames:

using OLT.Identity.Abstractions;

class Program 
{ 
	static void Main() 
	{ 
		Console.WriteLine($"Identity Provider Claim: {ClaimTypeNames.IdentityProvider}"); 
		Console.WriteLine($"Email Claim: {ClaimTypeNames.Email}"); 
		Console.WriteLine($"Audience Claim: {ClaimTypeNames.Audience}"); 
	} 
}

Within a Http Context

using OLT.Identity.Abstractions;

...

var nameId = HttpContext?.User.Claims.FirstOrDefault(p => p.Type == ClaimTypeNames.NameId)?.Value;

Claim Types

The OpenIdClaimTypes class provides a wide range of claim types, including but not limited to:

  • IdentityProvider: Identity Provider (typically used for local built-in providers)
  • AccessTokenHash: Access Token Validation
  • Active: If Token is still Active
  • Address: Preferred postal address
  • Audience: The "aud" (audience) claim identifies the recipients that the JWT is intended for
  • AuthenticationContextReference: Requested Authentication Context Class Reference values
  • AuthenticationMethodReference: Authentication Methods References
  • AuthenticationTime: Time when the End-User authentication occurred
  • AuthorizationServer: End-User's Authorization Server
  • AuthorizedParty: Authorized party - the party to which the ID Token was issued
  • Birthdate: End-User's birthday, represented as an ISO 8601:2004 YYYY-MM-DD format
  • ClientId: Client Id of Application with Authorization Server
  • CodeHash: The c_hash in the ID Token enables Clients to prevent Authorization Code substitution
  • Country: Address Claim - Country name component
  • Email: End-User's preferred e-mail address
  • EmailVerified: True if the End-User's e-mail address has been verified; otherwise false
  • ExpiresAt: The "exp" (expiration time) claim identifies the expiration time on or after which the JWT MUST NOT be accepted for processing
  • FamilyName: Surname(s) or last name(s) of the End-User
  • Formatted: Address Claim - Full mailing address, formatted for display or use on a mailing label
  • Gender: End-User's gender
  • GivenName: Given name(s) or first name(s) of the End-User
  • IssuedAt: The "iat" (issued at) claim identifies the time at which the JWT was issued
  • Issuer: The "iss" (issuer) claim identifies the principal that issued the JWT
  • Locale: End-User's locale, represented as a BCP47 language tag
  • Locality: Address Claim - City or locality component
  • JwtId: The "jti" (JWT ID) claim provides a unique identifier for the JWT
  • KeyId: End-User's Unique Key Id
  • MiddleName: Middle name(s) of the End-User
  • Name: End-User's full name in displayable form
  • NameId: End-User's Unique Name Id
  • Nickname: Casual name of the End-User
  • Nonce: String value used to associate a Client session with an ID Token, and to mitigate replay attacks
  • NotBefore: The "nbf" (not before) claim identifies the time before which the JWT MUST NOT be accepted for processing
  • PhoneNumber: End-User's preferred telephone number
  • PhoneNumberVerified: True if the End-User's phone number has been verified; otherwise false
  • Picture: URL of the End-User's profile picture
  • PostalCode: Address Claim - Zip code or postal code component
  • PreferredUsername: Shorthand name by which the End-User wishes to be referred to at the RP
  • Profile: URL of the End-User's profile page
  • Region: Address Claim - State, province, prefecture, or region component
  • Role: Roles
  • Scope: OpenID Connect Clients use scope values
  • StreetAddress: Full street address component
  • Subject: The "sub" (subject) claim identifies the principal that is the subject of the JWT
  • TokenType: Token Type - Auth Type/Method (Bearer, API Key, etc.)
  • Typ: The "typ" (type) Header Parameter used by JWT applications to declare the media type of this complete JWT
  • UpdatedAt: Time the End-User's information was last updated
  • Username: The username used to login
  • Website: URL of the End-User's Web page or blog
  • Zoneinfo: String from zoneinfo time zone database representing the End-User's time zone

License

This project is licensed under the MIT License. See the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on OLT.Identity.ClaimTypeNames:

Package Downloads
OLT.AspNetCore.Authentication.JwtBearer

OLT AspNetCore Autentication for JWT Tokens

OLT.Core.Model.Abstractions

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 141 12/6/2024
0.1.0-beta-0005 70 12/6/2024