Closed viniciussanchez closed 2 years ago
Hello @viniciussanchez
I don't like adding a dependency to TJWT knowing signing algorithms, but now I introduced new interfaces to simplify the token creation:
var
LResult: string;
begin
LResult := TJOSEProcess.New
.SetIssuer('Delphi JOSE Library')
.SetIssuedAt(Now)
.SetExpiration(Now + 1)
.SetAlgorithm(LAlg)
.SetKey(TJOSEAlgorithmId.HS256)
.Build
.GetCompactToken
;
memoCompact.Lines.Add(LResult);
end;
I hope that this new commit solve the issue.
Paolo.
Today to generate a token, you have to make 2 uses, as the documentation says. And I have to do it like this:
What do you think about creating a shortcut inside the TJWT class that calls TJOSE, looking like this:
I could do this with all the functions of the TJOSE class. With that I would need to make just one uses to generate the token and it would be simpler and more practical.