2222import java .util .HashMap ;
2323import java .util .List ;
2424import java .util .Map ;
25-
26- import org .oidc .msg .DeserializationException ;
2725import org .oidc .msg .ErrorDetails ;
2826import org .oidc .msg .ErrorType ;
2927import org .oidc .msg .ParameterVerification ;
@@ -235,7 +233,7 @@ protected void doVerify() {
235233 "at_hash must be in id token if returned with access token" ));
236234 } else {
237235 String atHash = TokenHash .compute ((String ) getClaims ().get ("access_token" ),
238- JWT . decode (( String ) getClaims ().get ("id_token" )). getAlgorithm ( ));
236+ ( String ) idToken . getHeader ().get ("alg" ));
239237 if (!((String ) idToken .getClaims ().get ("at_hash" )).equals (atHash )) {
240238 getError ().getDetails ().add (new ErrorDetails ("at_hash" , ErrorType .VALUE_NOT_ALLOWED ,
241239 String .format ("at_hash in id token not same as expected value '%s'" , atHash )));
@@ -251,7 +249,7 @@ protected void doVerify() {
251249 idTokenErrorDetails .toString ()));
252250 } else {
253251 String codeHash = TokenHash .compute ((String ) getClaims ().get ("code" ),
254- JWT . decode (( String ) getClaims ().get ("id_token" )). getAlgorithm ( ));
252+ ( String ) idToken . getHeader ().get ("alg" ));
255253 if (!((String ) idToken .getClaims ().get ("c_hash" )).equals (codeHash )) {
256254 ErrorDetails idTokenErrorDetails = new ErrorDetails ("c_hash" ,
257255 ErrorType .VALUE_NOT_ALLOWED ,
0 commit comments