Closed markm77 closed 4 years ago
Okay, I now see it seems to be set automatically in function below? Anyway I'll update this issue following testing - most likely to close it.
public mutating func sign(using jwtSigner: JWTSigner) throws -> String {
var tempHeader = header
tempHeader.alg = jwtSigner.name
let headerString = try tempHeader.encode()
let claimsString = try claims.encode()
header.alg = tempHeader.alg
return try jwtSigner.sign(header: headerString, claims: claimsString)
}
All fine in testing so far. 😀
Hi there,
Just curious why
alg
seems hard-coded to nil in Header class (https://github.com/IBM-Swift/Swift-JWT/blob/master/Sources/SwiftJWT/Header.swift)? I am experimenting with this library for UK Open Banking client registration where I need to set this value (see example Python code for this use case in 4.1.1 here: https://openbanking.atlassian.net/wiki/spaces/DZ/pages/313918598/Integrating+a+TPP+with+Ozone+Model+Banks+Using+Postman+on+Directory+SandboxMany thanks for any help!
BR, Mark