KEYCLOAK-5007 Used single-use cache for tracke OAuth code. OAuth code changed to be encrypted and signed JWT
This commit is contained in:
1 parent
63673c4328
commit
3b6e1f4e93
69 files changed
+1574
-464
No files matched your search
@@ -40,8 +40,8 @@ public class KeyUtils {
|
||||
private KeyUtils() {
|
||||
}
|
||||
|
||||
public static SecretKey loadSecretKey(byte[] secret) {
|
||||
return new SecretKeySpec(secret, "HmacSHA256");
|
||||
public static SecretKey loadSecretKey(byte[] secret, String javaAlgorithmName) {
|
||||
return new SecretKeySpec(secret, javaAlgorithmName);
|
||||
}
|
||||
|
||||
public static KeyPair generateRsaKeyPair(int keysize) {
|
||||
|
||||
@@ -16,7 +16,7 @@ public class KeyUtilsTest {
|
||||
byte[] secretBytes = new byte[32];
|
||||
ThreadLocalRandom.current().nextBytes(secretBytes);
|
||||
SecretKeySpec expected = new SecretKeySpec(secretBytes, "HmacSHA256");
|
||||
SecretKey actual = KeyUtils.loadSecretKey(secretBytes);
|
||||
SecretKey actual = KeyUtils.loadSecretKey(secretBytes, "HmacSHA256");
|
||||
assertEquals(expected.getAlgorithm(), actual.getAlgorithm());
|
||||
assertArrayEquals(expected.getEncoded(), actual.getEncoded());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user