hanicz opened a new pull request, #1099:
URL: https://github.com/apache/knox/pull/1099

   [KNOX-3192](https://issues.apache.org/jira/browse/KNOX-3192) - 
RemoteAuthProvider should support non-ssl url
   
   ## What changes were proposed in this pull request?
   
   To avoid `ClassCastException` the code now check for `HttpsURLConnection` 
instance before casting. This ensures the RemoteAuthProvider works with both 
SSL and non-SSL urls.
   
   ## How was this patch tested?
   
   HTTP
   
   ```
   <role>authentication</role>
   <name>RemoteAuthProvider</name>
   <enabled>true</enabled>
   <param>
       <name>remote.auth.url</name>
       <value>http://localhost:8443/gateway/sandbox/auth/api/v1/pre</value>
   </param>
   ```
   
   ```
   curl -iku admin:admin-password 
http://localhost:8443/gateway/rap/knoxtoken/api/v2/token
   HTTP/1.1 200 OK
   Date: Sat, 18 Oct 2025 07:11:58 GMT
   Content-Type: application/json
   Content-Length: 2195
   
   
{"access_token":"eyJqa3UiOiJodHRwOi8vbG9jYWxob3N0Ojg0NDMvZ2F0ZXdheS9yYXAva25veHRva2VuL2FwaS92Mi9qd2tzLmpzb24iLCJraWQiOiJyVGNXRlZRdFhmMjNTUFZRUmhXSHNFWTR6eENDb3BuQS1aTDFRU3luUENFIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImprdSI6Imh0dHA6Ly9sb2NhbGhvc3Q6ODQ0My9nYXRld2F5L3JhcC9rbm94dG9rZW4vY...
   ```
   
   HTTPS
   
   ```
   <role>authentication</role>
   <name>RemoteAuthProvider</name>
   <enabled>true</enabled>
   <param>
       <name>remote.auth.url</name>
       <value>https://localhost:8443/gateway/sandbox/auth/api/v1/pre</value>
   </param>
   ```
   
   ```
   curl -iku admin:admin-password 
https://localhost:8443/gateway/rap/knoxtoken/api/v2/token
   HTTP/1.1 200 OK
   Date: Sat, 18 Oct 2025 07:36:25 GMT
   Content-Type: application/json
   Content-Length: 2197
   
   
{"access_token":"eyJqa3UiOiJodHRwczovL2xvY2FsaG9zdDo4NDQzL2dhdGV3YXkvcmFwL2tub3h0b2tlbi9hcGkvdjIvandrcy5qc29uIiwia2lkIjoiZXY5dUNUVl96V2x0ZFYtZzduZHAtSHNUaFNGYVBkRjVmTzlfX0xhQmRibyIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiJhZG1pbiIsImprdSI6Imh0dHBzOi8vbG9jYWxob3N0Ojg0NDMvZ2F0ZXdheS9yYXAva25veHRva2VuL2FwaS92Mi9qd2tzLmpzb24i...
   ```
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to