For the complete documentation index, see llms.txt. This page is also available as Markdown.

CreateJWTToken

Create JSON Web Token.

Task version: 1.4.0

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Task Parameters

Name
Description

Issuer : String

Value for "iss" (Issuer) Claim.

Default: Issuer Example: Issuer

Audience : String

Value for "aud" (Audience) Claim.

Default: Audience Example: Audience

Expires : Nullable<DateTime>

Value for "exp" (Expiration Time) Claim.

Default: DateTime.Now.AddDays(7) Example: DateTime.Now.AddDays(7)

NotBefore : Nullable<DateTime>

Value for "nbf" (Not Before) Claim. Set to null if you don't want to include it.

Default: DateTime.Now.AddDays(1) Example: DateTime.Now.AddDays(1)

X509Thumbprint : String

Value for "x5t" (X.509 Certificate SHA-1 Thumbprint) Header.

Default: X5T Example: X5T

🗝PrivateKey : String

Private key for signing. The key should be in PEM format for asymmetric algorithms. If symmetric algorithms is used, key can be any string.

Default: - Example: -----BEGIN RSA PRIVATE KEY-----TheKey-----END RSA PRIVATE KEY-----

SigningAlgorithm : SigningAlgorithm

Algorithm used for signing, default is RS256. HS256/HS384/HS512 are symmetric algorithms, RS256/RS384/RS512 asymmetric.

Possible values:

  • RS256: Algorithm used for signing, default is RS256. HS256/HS384/HS512 are symmetric algorithms, RS256/RS384/RS512 asymmetric.

  • RS384: Algorithm used for signing, default is RS256. HS256/HS384/HS512 are symmetric algorithms, RS256/RS384/RS512 asymmetric.

  • RS512: Algorithm used for signing, default is RS256. HS256/HS384/HS512 are symmetric algorithms, RS256/RS384/RS512 asymmetric.

  • HS256: Algorithm used for signing, default is RS256. HS256/HS384/HS512 are symmetric algorithms, RS256/RS384/RS512 asymmetric.

  • HS384: Algorithm used for signing, default is RS256. HS256/HS384/HS512 are symmetric algorithms, RS256/RS384/RS512 asymmetric.

  • HS512: Algorithm used for signing, default is RS256. HS256/HS384/HS512 are symmetric algorithms, RS256/RS384/RS512 asymmetric.

  • ES256: Algorithm used for signing, default is RS256. HS256/HS384/HS512 are symmetric algorithms, RS256/RS384/RS512 asymmetric.

  • ES384: Algorithm used for signing, default is RS256. HS256/HS384/HS512 are symmetric algorithms, RS256/RS384/RS512 asymmetric.

  • ES512: Algorithm used for signing, default is RS256. HS256/HS384/HS512 are symmetric algorithms, RS256/RS384/RS512 asymmetric.

Default: RS256 Example: RS256

Claims : JwtClaim[]

Optional value(s) for "sub" (Subject) Claim. Multiple claims with same keys/names can be added.

Default: - Example: Name, Value

CustomHeaders : CustomHeader[]

Optional custom headers.

Default: - Example: kid, fsdjfosabgpasbgbbs

Task Result

Name
Description

Token : String

Token. Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJOYW1lIjoiQ2xhaW1lciIsIm5iZiI6sTY1NjQ5OTk3NiwiZXhwIjoxNjU2NTAwMDMyLCJpYXQiOjE2NTY0OTk5NzYsImlzckI6ImZyZW5kcyIsImF1ZCI6ImF1ZCJ9.qImoi_fSi2BL4aoxIvvaGUVoM7usX40Mrdodh4yD8BY"

Task Changelog

Changelog for Task Frends.OAuth.CreateJWTToken.

[1.4.0] - 2025-11-18

Fixes

  • Fix disposing of a private key issue when a task is reused in a process.

[1.3.0] - 2024-08-21

Added

  • Support for new IdentityModel-version.

[1.2.0] - 2023-12-21

Added

  • Support for ES256, ES384 and ES512 encryption algorithms.

[1.1.0] - 2023-12-04

Added

  • Not Before claim set to optional. Added feature to add customer headers to JWT header.

[1.0.0] - 2022-06-29

Added

  • Initial implementation

Last updated

Was this helpful?