proper null check for client's preferred signature method

pull/485/head
Justin Richer 2013-08-20 16:45:26 -04:00
parent 07bec462cc
commit ca777f7dc4
1 changed files with 3 additions and 6 deletions

View File

@ -89,12 +89,9 @@ public class ConnectTokenEnhancer implements TokenEnhancer {
claims.setJWTID(UUID.randomUUID().toString()); // set a random NONCE in the middle of it
JWSAlgorithm signingAlg;
JWSAlgorithm clientAlg = client.getIdTokenSignedResponseAlg().getAlgorithm();
if (clientAlg != null) {
signingAlg = clientAlg;
} else {
signingAlg = jwtService.getDefaultSigningAlgorithm();
JWSAlgorithm signingAlg = jwtService.getDefaultSigningAlgorithm();
if (client.getIdTokenSignedResponseAlg() != null) {
signingAlg = client.getIdTokenSignedResponseAlg().getAlgorithm();
}
SignedJWT signed = new SignedJWT(new JWSHeader(signingAlg), claims);