nokia / kong-oidc

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

How to return 401 before redirection to Keycloak? #188

Open mikomeister opened 3 years ago

mikomeister commented 3 years ago

Hello everyone, There is a simple question, after configuring Kong + oidc + keycloak as result we have the workflow described in the documentation, But have one concern - if tried login without Bearer token we got 302 and redirecting to Keycklok login page, But logically there first expected 403, then 302, finally 200 from keycloak login page. As I understand 403 raised somewhere under the hood of Kong/oidc. How I can show this error or make it visible from the network tab? image

mikomeister commented 3 years ago

Some clarification, for the case, when we login first time 302 might is ok, but might there option to return 40x code after token expired, to indicate that we need to refresh the token to continue.

alebuffoli commented 2 years ago

Hello @mikomeister, did you figure out a method to solve the issue?

mikomeister commented 2 years ago

Hi @alebuffoli , im find out that parameter config.bearer_only respond for this, set to true it (default no), after this will work without redirections

alebuffoli commented 2 years ago

@mikomeister thankyou so much!