jwt token Issuer, also in verification

This commit is contained in:
jeffcheasey88 2023-02-26 20:08:37 +01:00
parent 434e0ddea6
commit 8b90a99823
2 changed files with 5 additions and 2 deletions

View file

@ -43,8 +43,7 @@ public class Client extends Thread{
.setRequireExpirationTime()
.setAllowedClockSkewInSeconds(30)
.setRequireSubject()
.setExpectedIssuer("Issuer")
.setExpectedAudience("Audience")
.setExpectedIssuer(this.router.getTokenIssuer())
.setVerificationKey(this.router.getWebKey().getKey())
.setJwsAlgorithmConstraints(
ConstraintType.PERMIT, AlgorithmIdentifiers.RSA_USING_SHA256)

View file

@ -57,6 +57,10 @@ public class Router{
return this.rsaJsonWebKey;
}
public String getTokenIssuer(){
return this.token_issuer;
}
public String createAuthUser(int id) throws JoseException{
JwtClaims claims = new JwtClaims();
claims.setIssuer(token_issuer); // who creates the token and signs it