nokia / kong-oidc

OIDC plugin for Kong
Apache License 2.0
454 stars 320 forks source link

openidc_discover(): could not decode JSON from Discovery data & status=302 #88

Open aabou opened 5 years ago

aabou commented 5 years ago

Hello @Trojan295 or oidc-Group,

At the moment of discovery my kong can't decode json response (for information i use keycloak).

`[error] 3904#0: *396225 [lua] openidc.lua:497: openidc_discover(): could not decode JSON from Discovery data: response indicates failure, status=302, body=

302 Found

302 Found


openresty/1.13.6.2

`

Thanks in avance guys,

Trojan295 commented 5 years ago

Can you post basic information about:

aabou commented 5 years ago
aabou commented 5 years ago

I tried kong as a proxy for keycloak discovery url without oidc plugin and i had this kong error:

Kong Error An invalid response was received from the upstream server.

my service kong conf is:

{ "host": "localhost", "created_at": 1544797424, "connect_timeout": 60000, "id": "6f7d0692-31f0-4b77-9402-5c5d2003dc17", "protocol": "http", "name": "discovery", "read_timeout": 60000, "port": 8180, "path": "/auth/realms/kong/.well-known/openid-configuration", "updated_at": 1544797451, "retries": 5, "write_timeout": 60000, "extras": { "createdUser": null, "updatedUser": null, "kong_node_id": "1", "service_id": "6f7d0692-31f0-4b77-9402-5c5d2003dc17", "createdAt": "2018-12-14T14:23:44.476Z", "updatedAt": "2018-12-14T14:24:11.775Z", "id": 1 } }

in your opinion it can be kong or nginx issue?

EliuX commented 3 years ago

Verify that the port you are using is the right one (And it seems it is, 8080 regularly is the one for Keycloak), but also try to find what is the IP used by your Keycloak server. If you are using a Docker container, try something like

docker inspect <id of the container>

and checkout NetworkSettings.Networks.IPAddress.