Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: oauth/allow list #1067

Merged
merged 13 commits into from
Oct 27, 2024
Merged
Prev Previous commit
Next Next commit
chore: merge upstream branch
  • Loading branch information
tamassoltesz committed Oct 23, 2024
commit 8f9c59c8601ade5dd177771cb53c172128c82ae3
7 changes: 7 additions & 0 deletions src/main/java/io/supertokens/oauth/OAuth.java
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,14 @@ public static void addOrUpdateClient(Main main, AppIdentifier appIdentifier, Sto
oauthStorage.addOrUpdateOauthClient(appIdentifier, clientId, clientSecret, isClientCredentialsOnly, enableRefreshTokenRotation);
}


private static String encryptClientSecret(Main main, TenantIdentifier tenant, String clientSecret)
throws InvalidConfigException, InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException,
NoSuchPaddingException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException,
TenantOrAppNotFoundException {
if (clientSecret == null) {
return null;
}
String key = Config.getConfig(tenant, main).getOAuthClientSecretEncryptionKey();
clientSecret = Utils.encrypt(clientSecret, key);
return clientSecret;
Expand All @@ -377,6 +381,9 @@ private static String decryptClientSecret(Main main, TenantIdentifier tenant, S
throws InvalidConfigException, InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException,
NoSuchPaddingException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException,
TenantOrAppNotFoundException {
if (clientSecret == null) {
return null;
}
String key = Config.getConfig(tenant, main).getOAuthClientSecretEncryptionKey();
clientSecret = Utils.decrypt(clientSecret, key);
return clientSecret;
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.