Click or drag to resize

JsonWebTokenUtilityCreateHmacShaToken Method

Creates a Json Web Token (JWT) by given parameters (using symmetric algorithm HMAC-SHA)

Namespace:  Hummingbird.TestFramework.Util
Assembly:  Hummingbird.TestFramework (in Hummingbird.TestFramework.dll) Version: 1.2.0.0
Syntax
public static JwtSecurityToken CreateHmacShaToken(
	string base64Key,
	string algorithm,
	JwtPayload payload,
	out string token
)

Parameters

base64Key
Type: SystemString
The base64url encoded secret. The key size must match selected algorithm, for example with HS256, the key size must >= 256 bits.
algorithm
Type: SystemString
The signature or encryption algorithm, choose one from SecurityAlgorithms.
payload
Type: JwtPayload
The Jwt payload.
token
Type: SystemString
The string representation of the web token that can be used by the client.

Return Value

Type: JwtSecurityToken
A Json Web Token generated with given parameters
Remarks
According to the section 4 & 5 of RFC 4648, the Url Base64 encoding method used in JWT signature is different from regular Base 64 Encoding.
See Also