I’ve been testing out your docker image aspose/words-cloud and it looks like commit 729390d broke authentication with self-hosted containers.
AsposeWordsCloud::ApiError (Forbidden):
aspose_words_cloud (23.7.0) lib/aspose_words_cloud/api_client.rb:91:in `call_api'
aspose_words_cloud (23.7.0) lib/aspose_words_cloud/api/words_api.rb:14214:in `request_token'
aspose_words_cloud (23.7.0) lib/aspose_words_cloud/api/words_api.rb:42:in `initialize'
As a sanity check, I can confirm that the “old” path still works:
$ curl -v 'http://192.168.1.198:8080/connect/token' -d 'grant_type=client_credentials&client_id=james&client_secret=supersecretpassword' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: application/json'
* Trying 192.168.1.198:8080...
* Connected to 192.168.1.198 (192.168.1.198) port 8080 (#0)
> POST /connect/token HTTP/1.1
> Host: 192.168.1.198:8080
> User-Agent: curl/8.1.2
> Content-Type: application/x-www-form-urlencoded
> Accept: application/json
> Content-Length: 79
>
< HTTP/1.1 200 OK
< Content-Length: 175
< Content-Type: application/json; charset=utf-8
< Date: Wed, 02 Aug 2023 14:40:00 GMT
< Server: Kestrel
< api-supported-versions: 4.0
<
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE2OTA5ODcyMDEsImV4cCI6MTY5MTU5MjAwMSwiaWF0IjoxNjkwOTg3MjAxfQ.tgVbhSqWRfyJ0_gnodYz2B1BY1yR2BryLZEELq7qK8M"
* Connection #0 to host 192.168.1.198 left intact
}
Same error seen with the ruby client using the “new” path:
$ curl -v 'http://192.168.1.198:8080/v4.0/words/connect/token' -d 'grant_type=client_credentials&client_id=james&client_secret=supersecretpassword' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: application/json'
* Trying 192.168.1.198:8080...
* Connected to 192.168.1.198 (192.168.1.198) port 8080 (#0)
> POST /v4.0/words/connect/token HTTP/1.1
> Host: 192.168.1.198:8080
> User-Agent: curl/8.1.2
> Content-Type: application/x-www-form-urlencoded
> Accept: application/json
> Content-Length: 79
>
< HTTP/1.1 403 Forbidden
< Content-Length: 0
< Date: Wed, 02 Aug 2023 14:43:33 GMT
< Server: Kestrel
<
* Connection #0 to host 192.168.1.198 left intact
My guess is that the app in the running container doesn’t actually handle the path “/v4.0/words/connect/token.” If so, I’d guess that an up-to-date docker image is due for a release. Otherwise, I’d need to be able to configure the Ruby client to set the token URL to just “/connect/token” (without the /v4.0/words prefixed) but as you can see in that commit the path is hard-coded with no way to override it.
What are my options here to continue using your ruby client with your docker image for self hosting? In the meantime, I can pin the client dependency to 23.4.0 (the hardcoded path was introduced in 23.6.0), but would like to make sure we can eventually handle updating to a later version of the client (and the docker image) down the road.