# ParseToken

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.OAuth>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                                        | Description                                                                                                                                                                                                                                                                              |
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AuthHeaderOrToken : `String`                | <p>Either the JWT token or the Authorization header value through #trigger.data.httpHeaders\["Authorization"].</p><p><br>Default: <code>#trigger.data.httpHeaders\["Authorization"]</code><br>Example: <code>#trigger.data.httpHeaders\["Authorization"]</code></p>                      |
| Audience : `String`                         | <p>The expected Audiences of the token, e.g. ClientId.</p><p><br>Default: <code>-</code><br>Example: <code>fIVLouKUZasdYP3tdO9D3dwd6ZNS9Be</code></p>                                                                                                                                    |
| Issuer : `String`                           | <p>The expected Issuer of the token.</p><p><br>Default: <code><https://xyz.eu.auth0.com/></code><br>Example: <code><https://xyz.eu.auth0.com/></code></p>                                                                                                                                |
| ConfigurationSource : `ConfigurationSource` | <p>The configuration source.</p><p>Possible values:</p><ul><li><code>WellKnownConfigurationUrl</code>:</li></ul><p>The configuration source.</p><ul><li><code>Static</code>:</li></ul><p>The configuration source.</p><p><br>Default: <code>1</code><br>Example: <code>Static</code></p> |
| WellKnownConfigurationUrl : `String`        | <p>The URL where the .well-known configuration for the issuer is located.</p><p><br>Default: <code><https://xyz.eu.auth0.com/.well-known/openid-configuration></code><br>Example: <code><https://xyz.eu.auth0.com/.well-known/openid-configuration></code></p>                           |
| StaticJwksConfiguration : `String`          | <p>Static signing keys to use, can be found in the jwks\_uri from the .well-known openid-configurations.</p><p><br>Default: <code>-</code><br>Example: <code>o80vbR0ZfMhjZWfqwPUGNkcIeUcweFyzB2S2T</code></p>                                                                            |
| {% endtab %}                                |                                                                                                                                                                                                                                                                                          |

{% tab title="Parameter: Options" %}

| Name                               | Description                                                                                                                                                                   |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SkipIssuerValidation : `Boolean`   | <p>Should the issuer (iss) validation be skipped.</p><p><br>Default: <code>-</code><br>Example: <code>True</code></p>                                                         |
| SkipAudienceValidation : `Boolean` | <p>Should audience (aud) validation be skipped.</p><p><br>Default: <code>-</code><br>Example: <code>True</code></p>                                                           |
| SkipLifetimeValidation : `Boolean` | <p>Should lifetime (exp,nbf) validation be skipped.</p><p><br>Default: <code>-</code><br>Example: <code>True</code></p>                                                       |
| DecryptToken : `Boolean`           | <p>Should the Token be decrypted.</p><p><br>Default: <code>-</code><br>Example: <code>True</code></p>                                                                         |
| 🗝DecryptionKey : `String`         | <p>Decryption key, should be in PEM format.</p><p><br>Default: <code>-</code><br>Example: <code>-----BEGIN RSA PRIVATE KEY-----TheKey-----END RSA PRIVATE KEY-----</code></p> |
| {% endtab %}                       |                                                                                                                                                                               |

{% tab title="Result: ParseResult" %}

| Name                                  | Description                                                                                                                                                                                                   |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Id : `String`                         | <p>Unique identifier of the security token.<br>Example: <code>9b3250d8d5ee432</code></p>                                                                                                                      |
| Issuer : `String`                     | <p>'issuer' claim { iss, 'value' }.<br>Example: <code><https://frends.com/>"</code></p>                                                                                                                       |
| Audiences : `String`                  | <p>'audience' claim { aud, 'value' }.<br>Example: <code>"fIVLouKYRihXfYN6tdO9D3dwd6ZNS9Be"</code></p>                                                                                                         |
| SecurityKeyId : `String`              | <p>SecurityKeys for this instance.<br>Example: <code>gHVXsCt97WM6oGYVm0U0NUaGh7M5MF2CvysUNpShwcU21BAnkKU4Xg</code></p>                                                                                        |
| SigningKeyId : `String`               | <p>SecurityKeys for this instance.<br>Example: <code>gHVXsCt97WM6oGYVm0U0NUaGh7M5MF2CvysUNpShwcU21BAnkKU4Xg</code></p>                                                                                        |
| ValidFrom : `DateTime`                | <p>Gets the 'value' of the 'notbefore' claim { nbf, 'value' } converted to a DateTime assuming 'value' is seconds since UnixEpoch (UTC 1970-01-01T0:0:0Z).<br>Example: <code>0001-01-01 0:00:00</code></p>    |
| ValidTo : `DateTime`                  | <p>Gets the 'value' of the 'expiration' claim { exp, 'value' } converted to a DateTime assuming 'value' is seconds since UnixEpoch (UTC 1970-01-01T0:0:0Z).<br>Example: <code>2018-10-18 20:00:00</code></p>  |
| Claims : `Dictionary<String, Object>` | <p>A dictionary of all claims in the token.<br>Example: <code>{ {"nickname", "foobar"}, {"name", "Foo Bar"}, {"updated\_at", "2018-10-18T10:10:19.4430000Z"}, {"iss", "<https://foo.bar/"}>, ... }</code></p> |
| {% endtab %}                          |                                                                                                                                                                                                               |

{% tab title="Changelog" %}

## Changelog

### \[1.3.0] - 2025-12-02

#### Added

* Support for handling array-type claims in the token, such as `"roles": ["editor", "admin"]`.

### \[1.2.0] - 2024-08-21

#### Added

* Support for new IdentityModel-versions.

### \[1.1.0] - 2023-12-08

#### Added

* New dictionary parameter 'ParseResult.Claims' that contains all claims in the token.

### \[1.0.1] - 2022-08-04

#### Changed

* Using custom result values instead of MS library classes for Frends integrity.

### \[1.0.0] - 2022-07-01

#### Added

* Initial implementation
  {% endtab %}
  {% endtabs %}
