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() .setRequireExpirationTime()
.setAllowedClockSkewInSeconds(30) .setAllowedClockSkewInSeconds(30)
.setRequireSubject() .setRequireSubject()
.setExpectedIssuer("Issuer") .setExpectedIssuer(this.router.getTokenIssuer())
.setExpectedAudience("Audience")
.setVerificationKey(this.router.getWebKey().getKey()) .setVerificationKey(this.router.getWebKey().getKey())
.setJwsAlgorithmConstraints( .setJwsAlgorithmConstraints(
ConstraintType.PERMIT, AlgorithmIdentifiers.RSA_USING_SHA256) ConstraintType.PERMIT, AlgorithmIdentifiers.RSA_USING_SHA256)

View file

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