#### [Abblix\.Jwt](https://www.abblix.com/en/docs/api/abblix-jwt 'index')
### [Abblix\.Jwt](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt 'Abblix\.Jwt')

## JwtTypeName Class

Compares JWT `typ` header values, which name a media type and therefore have more than one spelling
for the same value\.

```csharp
public static class JwtTypeName
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → JwtTypeName

### Remarks
Two rules make the spellings equivalent\. RFC 7515 Section 4\.1\.9: "A recipient using the media type value
MUST treat it as if 'application/' were prepended to any 'typ' value not containing a '/'", so
`at+jwt` and `application/at+jwt` are one name\. RFC 2045 Section 5\.1: "Matching of media type and
subtype is ALWAYS case\-insensitive", so casing carries no meaning either\.
Note that RFC 7515 Section 5\.3, which defines this library's general string\-comparison rules, does not
apply: it ends by exempting exactly this parameter, "Only the 'typ' and 'cty' member values defined in this
specification do not use these comparison rules"\.
This lives here rather than beside each comparison so the rule has one implementation: a second copy would
be a second, quietly different answer to "is this an access token"\.
### Methods

## JwtTypeName\.Matches\(string, string\) Method {#Abblix.Jwt.JwtTypeName.Matches(string,string)}

Determines whether two `typ` values name the same token type, in any spelling of either\.

```csharp
public static bool Matches(string? actual, string expected);
```
#### Parameters

###### `actual` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Jwt.JwtTypeName.Matches(string,string).actual}

The value read from the token's header, or `null` when it carries none\.

###### `expected` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Jwt.JwtTypeName.Matches(string,string).expected}

The value the caller expects, written in whichever spelling it prefers\.

#### Returns
[System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean')  
`true` when both name the same media type\.

## JwtTypeName\.StripApplicationPrefix\(string\) Method {#Abblix.Jwt.JwtTypeName.StripApplicationPrefix(string)}

Removes the `application/` prefix when present, reaching RFC 7515 Section 4\.1\.9's equivalence from
either form rather than only from the short one\.

```csharp
public static string StripApplicationPrefix(string typ);
```
#### Parameters

###### `typ` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Jwt.JwtTypeName.StripApplicationPrefix(string).typ}

The `typ` value to normalise\.

#### Returns
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')  
The value without its media\-type prefix\.

### Remarks
The prefix match ignores case because it is the media type portion, which RFC 2045 Section 5\.1 declares
case\-insensitive; matching it ordinally would leave `Application/at+jwt` unstripped and therefore
unmatchable\.
