By: Marius Popescu user 13 Dec 2016 at 11:07 a.m. CST

3 Responses
Marius Popescu gravatar
Hi there I am trying to test the API gateway feature integration with UMA and Kong (kong-uma-rs plugin) I have added an API and trying to get this proxied by Kong and UMA but still having issues Could you guys give me a hand in order to troubleshoot it ? ``` $ curl -i -X POST \ --url http://localhost:8001/apis/ \ --data 'name=your.api.server' \ --data 'upstream_url=http://your.api.server.com/' \ --data 'request_host=your.api.server.com' ``` Response must confirm the API is added ``` HTTP/1.1 201 Created Content-Type: application/json Connection: keep-alive { "request_host": "your.api.server.com", "upstream_url": "http://your.api.server.com/", "id": "2eec1cb2-7093-411a-c14e-42e67142d2c4", "created_at": 1428456369000, "name": "your.api.server" } ``` Validate your API is correctly proxied via Kong. Request ================================ ``` curl -i -X GET --url http://localhost:8000/mockbin --header 'Host: mockbin.com' ``` Response ======================================= ``` HTTP/1.1 404 Not Found Date: Tue, 13 Dec 2016 17:02:31 GMT Content-Type: text/html; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive Set-Cookie: __cfduid=d0135f7299c96bf8f76827770b003df0d1481648551; expires=Wed, 13-Dec-17 17:02:31 GMT; path=/; domain=.mockbin.com; HttpOnly X-Content-Type-Options: nosniff Vary: Accept-Encoding Via: kong/0.9.5 Server: cloudflare-nginx CF-RAY: 310afbf554300ee5-EWR X-Kong-Upstream-Latency: 61 X-Kong-Proxy-Latency: 0 ``` Cannot GET /mockbin Then I've added the kong-uma-rs plugin to this API but when I'm trying to make a call to the /document protected resource I'm getting the error message that /document is not procted ``` curl -i -X POST \ --url http://localhost:8001/apis/mockbin/plugins/ \ --data 'name=kong-uma-rs' \ --data "config.oxd_host=localhost" \ --data "config.oxd_port=8099" \ --data "config.uma_server_host=https://localhost" \ --data "config.protection_document={\"resources\":[ { \"path\":\"/document\", \"conditions\":[ { \"httpMethods\":[\"GET\"], \"scopes\":[ \"http://photoz.example.com/dev/actions/view\" ] } ] } ] }" ``` Thanks Marius

By Marius Popescu user 13 Dec 2016 at 12:22 p.m. CST

Marius Popescu gravatar
Trying to add the kong-uma-rs plugin to the mockbin API previously added curl -i -X POST --url http://localhost:8001/apis/mockbin/plugins/ --data 'name=kong-uma-rs' --data "config.oxd_host=localhost" --data "config.oxd_port=8099" --data "config.uma_server_host=http://lablws02a.ile.montreal.qc.ca" --data "config.protection_document={\"resources\":[{\"path\":\"/document\",\"conditions\":[{\"httpMethods\":[\"GET\"],\"scopes\":[\"http://photoz.example.com/dev/actions/view\"]}]}]}" ======================================================= I got the 500 Internal Server Error HTTP/1.1 500 Internal Server Error Date: Tue, 13 Dec 2016 18:22:21 GMT Content-Type: application/json; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive Access-Control-Allow-Origin: * Server: kong/0.9.5 {"message":"An unexpected error occurred"}

By Yuriy Zabrovarnyy staff 13 Dec 2016 at 4:25 p.m. CST

Yuriy Zabrovarnyy gravatar
Hi Marius, 1. "your.api.server.com" should be replaced with valid API installation. It seems just copy/paste from sample, please replace it with valid server. 2. for uma_server_host you have https://localhost. Please hit in your browser https://localhost/.well-known/uma-configuration and paste response of this call here (we need to make sure it contains valid UMA AS installation). 3. make sure oxd server is up and running on 8099 port. Please attach to the ticket oxd-server.log file so I can investigate it. 4. It would be helpful if you post here all curl commands you executed against kong. Thanks, Yuriy

By Marius Popescu user 16 Dec 2016 at 11:41 a.m. CST

Marius Popescu gravatar
It seems to be working now. It was some king intermitent working. I'll let you know if need be. Thanks