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
)
Public Shared Function CreateHmacShaToken (
base64Key As String,
algorithm As String,
payload As JwtPayload,
<OutAttribute> ByRef token As String
) As JwtSecurityToken
public:
static JwtSecurityToken^ CreateHmacShaToken(
String^ base64Key,
String^ algorithm,
JwtPayload^ payload,
[OutAttribute] String^% token
)
static member CreateHmacShaToken :
base64Key : string *
algorithm : string *
payload : JwtPayload *
token : string byref -> JwtSecurityToken
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:
JwtSecurityTokenA 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