You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by am...@apache.org on 2023/07/14 10:52:46 UTC
[knox] branch master updated: KNOX-2938 - jwks.json doesn't have double quotes which makes json invalid (#771)
This is an automated email from the ASF dual-hosted git repository.
amagyar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git
The following commit(s) were added to refs/heads/master by this push:
new 1b2424d6c KNOX-2938 - jwks.json doesn't have double quotes which makes json invalid (#771)
1b2424d6c is described below
commit 1b2424d6c13480df40a654df5ee524083ab96943
Author: Attila Magyar <m....@gmail.com>
AuthorDate: Fri Jul 14 12:52:42 2023 +0200
KNOX-2938 - jwks.json doesn't have double quotes which makes json invalid (#771)
---
.../java/org/apache/knox/gateway/service/knoxtoken/JWKSResource.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/JWKSResource.java b/gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/JWKSResource.java
index 0fba2c23e..575caa06c 100644
--- a/gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/JWKSResource.java
+++ b/gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/JWKSResource.java
@@ -39,6 +39,7 @@ import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.security.KeyStore;
import java.security.KeyStoreException;
@@ -105,7 +106,7 @@ public class JWKSResource {
+ "\"\n}\n").build();
}
return Response.ok()
- .entity(jwks.toJSONObject().toString()).build();
+ .entity(jwks.toString()).type(MediaType.APPLICATION_JSON_TYPE).build();
}
protected RSAPublicKey getPublicKey(final String keystore) throws KeystoreServiceException, KeyStoreException {