Source:
private static com.nimbusds.jwt.JWTClaimsSet createJWTClaimSet ( javax.servlet.http.HttpServletRequest request , org.ovirt.engine.core.sso.utils.SsoSession ssoSession , java.lang.String clientId ) { java.lang.String serverName = request.getServerName ( ) ; java.lang.String issuer = java.lang.String.format ( "%s://%s:%s" , request.getScheme ( ) , ( org.apache.http.conn.util.InetAddressUtils.isIPv6Address ( serverName ) ? java.lang.String.format ( "[%s]" , serverName ) : serverName ) , request.getServerPort ( ) ) ; java.util.Date expirationTime = new java.util.Date ( ( ( ssoSession.getAuthTime ( ) . getTime ( ) ) + ( 30000 * 60 ) ) ) ; com.nimbusds.jwt.JWTClaimsSet.Builder jwtClaimsBuilder = new com.nimbusds.jwt.JWTClaimsSet.Builder ( ) . jwtID ( ssoSession.getPrincipalRecord ( ) . get ( Authz.PrincipalRecord.ID ) ) . issueTime ( ssoSession.getAuthTime ( ) ) . expirationTime ( expirationTime ) . issuer ( issuer ) . subject ( java.lang.String.format ( "%s@%s" , ssoSession.getUserId ( ) , ssoSession.getProfile ( ) ) ) . audience ( clientId ) . claim ( "acr" , "0" ) . claim ( "auth_time" , ssoSession.getAuthTime ( ) ) . claim ( "sub" , java.lang.String.format ( "%s@%s" , ssoSession.getUserId ( ) , ssoSession.getProfile ( ) ) ) . claim ( "preferred_username" , java.lang.String.format ( "%s@%s" , ssoSession.getUserId ( ) , ssoSession.getProfile ( ) ) ) . claim ( "email" , ssoSession.getPrincipalRecord ( ) . < java.lang.String > get ( Authz.PrincipalRecord.EMAIL ) ) . claim ( "name" , ssoSession.getPrincipalRecord ( ) . < java.lang.String > get ( Authz.PrincipalRecord.FIRST_NAME ) ) . claim ( "family_name" , ssoSession.getPrincipalRecord ( ) . < java.lang.String > get ( Authz.PrincipalRecord.FIRST_NAME ) ) . claim ( "given_name" , ssoSession.getPrincipalRecord ( ) . < java.lang.String > get ( Authz.PrincipalRecord.FIRST_NAME ) ) ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( ssoSession.getOpenIdNonce ( ) ) ) { jwtClaimsBuilder.claim ( "nonce" , ssoSession.getOpenIdNonce ( ) ) ; } return jwtClaimsBuilder.build ( ) ; }

Target:
private static com.nimbusds.jwt.JWTClaimsSet createJWTClaimSet ( javax.servlet.http.HttpServletRequest request , org.ovirt.engine.core.sso.utils.SsoSession ssoSession , java.lang.String clientId ) { java.lang.String serverName = request.getServerName ( ) ; java.lang.String issuer = java.lang.String.format ( "%s://%s:%s" , request.getScheme ( ) , ( org.apache.http.conn.util.InetAddressUtils.isIPv6Address ( serverName ) ? java.lang.String.format ( "[%s]" , serverName ) : serverName ) , request.getServerPort ( ) ) ; java.util.Date expirationTime = new java.util.Date ( ( ( ssoSession.getAuthTime ( ) . getTime ( ) ) + ( 30000 * 60 ) ) ) ; com.nimbusds.jwt.JWTClaimsSet.Builder jwtClaimsBuilder = new com.nimbusds.jwt.JWTClaimsSet.Builder ( ) . jwtID ( ssoSession.getPrincipalRecord ( ) . get ( Authz.PrincipalRecord.ID ) ) . issueTime ( ssoSession.getAuthTime ( ) ) . expirationTime ( expirationTime ) . issuer ( issuer ) . subject ( ssoSession.getUserIdWithProfile ( ) ) . audience ( clientId ) . claim ( "acr" , "0" ) . claim ( "auth_time" , ssoSession.getAuthTime ( ) ) . claim ( "sub" , ssoSession.getUserIdWithProfile ( ) ) . claim ( "preferred_username" , ssoSession.getUserIdWithProfile ( ) ) . claim ( "email" , ssoSession.getPrincipalRecord ( ) . < java.lang.String > get ( Authz.PrincipalRecord.EMAIL ) ) . claim ( "name" , ssoSession.getPrincipalRecord ( ) . < java.lang.String > get ( Authz.PrincipalRecord.FIRST_NAME ) ) . claim ( "family_name" , ssoSession.getPrincipalRecord ( ) . < java.lang.String > get ( Authz.PrincipalRecord.FIRST_NAME ) ) . claim ( "given_name" , ssoSession.getPrincipalRecord ( ) . < java.lang.String > get ( Authz.PrincipalRecord.FIRST_NAME ) ) ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( ssoSession.getOpenIdNonce ( ) ) ) { jwtClaimsBuilder.claim ( "nonce" , ssoSession.getOpenIdNonce ( ) ) ; } return jwtClaimsBuilder.build ( ) ; }