proper null check for client's preferred signature method

pull/650/head
Justin Richer 11 years ago
parent 9df10d3871
commit 897e4cbfed

@ -84,12 +84,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);

Loading…
Cancel
Save