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

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

                Author: ASF GitHub Bot
            Created on: 06/Apr/21 20:38
            Start Date: 06/Apr/21 20:38
    Worklog Time Spent: 10m 
      Work Description: moresandeep commented on a change in pull request #429:
URL: https://github.com/apache/knox/pull/429#discussion_r608164556



##########
File path: 
gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/JWKSResource.java
##########
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.knox.gateway.service.knoxtoken;
+
+import com.nimbusds.jose.JOSEException;
+import com.nimbusds.jose.JWSAlgorithm;
+import com.nimbusds.jose.jwk.JWKSet;
+import com.nimbusds.jose.jwk.KeyUse;
+import com.nimbusds.jose.jwk.RSAKey;
+import org.apache.knox.gateway.config.GatewayConfig;
+import org.apache.knox.gateway.services.GatewayServices;
+import org.apache.knox.gateway.services.ServiceType;
+import org.apache.knox.gateway.services.security.KeystoreService;
+import org.apache.knox.gateway.services.security.KeystoreServiceException;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import java.security.KeyStoreException;
+import java.security.interfaces.RSAPublicKey;
+
+import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
+
+@Singleton
+@Path(JWKSResource.RESOURCE_PATH)
+public class JWKSResource {
+
+  static final String RESOURCE_PATH = "knoxtoken/api/v1/.well-known";

Review comment:
       There is no official standard as such. I was just going by the pattern 
used by services such as 
[auth0](https://auth0.com/docs/tokens/json-web-tokens/json-web-key-sets/locate-json-web-key-sets)
 This is an example
   `https://YOUR_DOMAIN/.well-known/openid-configuration`
   I do agree that this does not add any value given it not a well known 
endpoint (since it is part of a topology) there is no point in adding 
`.well-known` 
   I will update it to `knoxtoken/api/v1/jwks.json`




-- 
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: 577884)
    Time Spent: 0.5h  (was: 20m)

> Support for JWKS endpoint
> -------------------------
>
>                 Key: KNOX-2570
>                 URL: https://issues.apache.org/jira/browse/KNOX-2570
>             Project: Apache Knox
>          Issue Type: New Feature
>          Components: Server
>            Reporter: Sandeep More
>            Assignee: Sandeep More
>            Priority: Major
>             Fix For: 1.6.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> With knox handing out tokens to other applications it would be nice to 
> provide a JWKS endpoint to to verify tokens. 
> It should be noted that this will work for tokens signed using asymmetric 
> keys.



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

Reply via email to