kong-plugin-jwt-keycloak
kong-plugin-jwt-keycloak copied to clipboard
Adapt the plugin to kong v3.0.0
based on the new kong upgrade, the handler declaration and the schema declaration were fixed https://docs.konghq.com/gateway/latest/upgrade/
I am not sure, if this PR will ever be merged, given the statement in the README
Maybe it is time to start looking for a new maintainer and a new home for this plugin. We are interested in keeping this plugin alive and would support any efforts in this matter.
I can see a few forks that actually contain somewhat recent commits. I will try to chime in the Maintainers, let's discuss this.
@hanfi I tried your PR with kong 3.0 and keycloak 18.0 when trying to reach endpoint with valid token, get this
..ocal/share/lua/5.1/kong/plugins/jwt-keycloak/handler.lua:327: attempt to index field 'super' (a nil value),
it looks access function is not part of super JwtKeycloakHandler.super.access(self)
code auto-complete also doesen't list access under super. only new is under super available.
@gruppferi sry mate saw this one but didn't had time to fix it yet.
https://docs.konghq.com/gateway/latest/plugin-development/custom-logic/

https://github.com/Kong/kong-plugin
i have to fix this and make a commit.
and since you are in the OIDC plugin PR also i'll fix it in both
i did the commit, it's just two lines to delete :D try and tell me if it works for you.
Hey @hanfi , could you please tag your repo as v1.1.1-0 ( with those changes) ?
Since if we pulling master and you add new changes it may break
Btw its working with kong 3.1.1 and ttps://github.com/revomatico/kong-oidc.git
@sqoshi here tag pushed thx for the update https://github.com/hanfi/kong-plugin-jwt-keycloak/releases/tag/v1.1.1-0
I'm using https://github.com/revomatico/kong-oidc for oidc and your repository for jwt. I enabled 2 plugin with scope required is user. When i get access token and connect to service with:
#!/bin/bash
auth_url='http://localhost:8080/'
realm_name='kong'
client_id='kong_client'
client_secret='CEkLLq8qhWvHhccWxk5LSirfWM0hkcDm'
username='user1'
password='123abc'
url='http://localhost:8000/httpbin2'
token=$(curl -X POST \
"${auth_url}/realms/${realm_name}/protocol/openid-connect/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=${client_id}" \
-d "client_secret=${client_secret}" \
-d "username=${username}" \
-d "password=${password}" \
-d "grant_type=password" | jq -r '.access_token')
The connection successed authen with scope 'user'. But when I visit the configured route in kong with browser i get redirected to keycloak to authenticate and after success auth i get this error:
{"message":"Unauthorized"}
Is this error by cookie?
Can you help me this? @hanfi
@ahhduy you should put this in a separate issue, this issue should not be a general Q&A issue, but be related to the kong 3 upgrade.
I am about to archive this repository. Please move your issues/PRs the successor of this repo: https://github.com/telekom-digioss/kong-plugin-jwt-keycloak