1313import com .networknt .oauth .cache .model .User ;
1414import com .networknt .oauth .token .helper .HttpAuth ;
1515import com .networknt .security .JwtConfig ;
16- import com .networknt .security .JwtHelper ;
16+ import com .networknt .security .JwtIssuer ;
1717import com .networknt .status .Status ;
1818import com .networknt .utility .CodeVerifierUtil ;
1919import com .networknt .utility .HashUtil ;
@@ -139,7 +139,7 @@ private Map<String, Object> handleClientCredentials(HttpServerExchange exchange,
139139 if (customClaim != null && customClaim .length () > 0 ) {
140140 customMap = Config .getInstance ().getMapper ().readValue (customClaim , new TypeReference <Map <String , Object >>(){});
141141 }
142- jwt = JwtHelper .getJwt (mockCcClaims (client .getClientId (), scope , customMap ));
142+ jwt = JwtIssuer .getJwt (mockCcClaims (client .getClientId (), scope , customMap ));
143143 } catch (Exception e ) {
144144 logger .error ("Exception:" , e );
145145 throw new ApiException (new Status (GENERIC_EXCEPTION , e .getMessage ()));
@@ -233,7 +233,7 @@ private Map<String, Object> handleAuthorizationCode(HttpServerExchange exchange,
233233 if (customClaim != null && customClaim .length () > 0 ) {
234234 customMap = Config .getInstance ().getMapper ().readValue (customClaim , new TypeReference <Map <String , Object >>(){});
235235 }
236- jwt = JwtHelper .getJwt (mockAcClaims (client .getClientId (), scope , userId , user .getUserType ().toString (), customMap ));
236+ jwt = JwtIssuer .getJwt (mockAcClaims (client .getClientId (), scope , userId , user .getUserType ().toString (), customMap ));
237237 } catch (Exception e ) {
238238 throw new ApiException (new Status (GENERIC_EXCEPTION , e .getMessage ()));
239239 }
@@ -296,7 +296,7 @@ private Map<String, Object> handlePassword(HttpServerExchange exchange, Map<Stri
296296 if (customClaim != null && customClaim .length () > 0 ) {
297297 customMap = Config .getInstance ().getMapper ().readValue (customClaim , new TypeReference <Map <String , Object >>(){});
298298 }
299- String jwt = JwtHelper .getJwt (mockAcClaims (client .getClientId (), scope , userId , user .getUserType ().toString (), customMap ));
299+ String jwt = JwtIssuer .getJwt (mockAcClaims (client .getClientId (), scope , userId , user .getUserType ().toString (), customMap ));
300300 // generate a refresh token and associate it with userId and clientId
301301 String refreshToken = UUID .randomUUID ().toString ();
302302 RefreshToken token = new RefreshToken ();
@@ -366,7 +366,7 @@ private Map<String, Object> handleRefreshToken(HttpServerExchange exchange, Map<
366366 if (customClaim != null && customClaim .length () > 0 ) {
367367 customMap = Config .getInstance ().getMapper ().readValue (customClaim , new TypeReference <Map <String , Object >>(){});
368368 }
369- jwt = JwtHelper .getJwt (mockAcClaims (client .getClientId (), scope , userId , user .getUserType ().toString (), customMap ));
369+ jwt = JwtIssuer .getJwt (mockAcClaims (client .getClientId (), scope , userId , user .getUserType ().toString (), customMap ));
370370 } catch (Exception e ) {
371371 throw new ApiException (new Status (GENERIC_EXCEPTION , e .getMessage ()));
372372 }
@@ -438,7 +438,7 @@ private Map<String, Object> handleClientAuthenticatedUser(HttpServerExchange exc
438438 }
439439 String jwt ;
440440 try {
441- jwt = JwtHelper .getJwt (mockAcClaims (client .getClientId (), scope , userId , userType , formMap ));
441+ jwt = JwtIssuer .getJwt (mockAcClaims (client .getClientId (), scope , userId , userType , formMap ));
442442 } catch (Exception e ) {
443443 throw new ApiException (new Status (GENERIC_EXCEPTION , e .getMessage ()));
444444 }
@@ -513,7 +513,7 @@ private Client validateClientSecret(String clientId, String clientSecret) throws
513513 }
514514
515515 private JwtClaims mockCcClaims (String clientId , String scopeString , Map <String , Object > formMap ) {
516- JwtClaims claims = JwtHelper .getDefaultJwtClaims ();
516+ JwtClaims claims = JwtIssuer .getDefaultJwtClaims ();
517517 claims .setClaim ("client_id" , clientId );
518518 List <String > scope = Arrays .asList (scopeString .split ("\\ s+" ));
519519 claims .setStringListClaim ("scope" , scope ); // multi-valued claims work too and will end up as a JSON array
@@ -526,7 +526,7 @@ private JwtClaims mockCcClaims(String clientId, String scopeString, Map<String,
526526 }
527527
528528 private JwtClaims mockAcClaims (String clientId , String scopeString , String userId , String userType , Map <String , Object > formMap ) {
529- JwtClaims claims = JwtHelper .getDefaultJwtClaims ();
529+ JwtClaims claims = JwtIssuer .getDefaultJwtClaims ();
530530 claims .setClaim ("user_id" , userId );
531531 claims .setClaim ("user_type" , userType );
532532 claims .setClaim ("client_id" , clientId );
0 commit comments