[ 
https://issues.apache.org/jira/browse/KNOX-2126?focusedWorklogId=344581&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-344581
 ]

ASF GitHub Bot logged work on KNOX-2126:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 15/Nov/19 21:05
            Start Date: 15/Nov/19 21:05
    Worklog Time Spent: 10m 
      Work Description: sidseth commented on pull request #195: KNOX-2126. Add 
an API to retrieve the public key used for Knox JWT verification.
URL: https://github.com/apache/knox/pull/195#discussion_r347010672
 
 

 ##########
 File path: 
gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/TokenResource.java
 ##########
 @@ -278,6 +284,39 @@ public Response revoke(String token) {
     return resp;
   }
 
+  @GET
+  @Path(PUBLIC_KEY_PATH)
+  @Produces ({APPLICATION_JSON})
+  public Response publicKey() {
+    GatewayServices services = (GatewayServices) request.getServletContext()
+        .getAttribute(GatewayServices.GATEWAY_SERVICES_ATTRIBUTE);
+
+    KeystoreService ks = services.getService(ServiceType.KEYSTORE_SERVICE);
+
+    try {
+      PublicKey publicKey = 
ks.getSigningKeystore().getCertificate(getSigningKeyAlias()).getPublicKey();
+      publicKey.getAlgorithm();
 
 Review comment:
   Removed. Left over from testing.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 344581)
    Time Spent: 1h 20m  (was: 1h 10m)

> Add an API to retrieve the public key used for Knox JWT verification
> --------------------------------------------------------------------
>
>                 Key: KNOX-2126
>                 URL: https://issues.apache.org/jira/browse/KNOX-2126
>             Project: Apache Knox
>          Issue Type: New Feature
>            Reporter: Siddharth Seth
>            Priority: Major
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> It can be useful to get access to the PublicKey used by Knox to verify the 
> tokens that it generates outside of Knox.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to