Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle token headers without bearer string #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

seboudry
Copy link

Hi!

When used with revomatico/kong-oidc without Authorization bearer token, request failed.

This MR change the behavior of this plugin to remove "bearer" string prefix in token header value only if exists.

Tested with this configuration of kong-oidc that used classic bearer token for non regression:

apiVersion: configuration.konghq.com/v1
kind: KongClusterPlugin
metadata:
  name: oidc-sso
  annotations:
    kubernetes.io/ingress.class: kong
plugin: oidc
config:
  client_id: xxxxxxxxxxxxxxxxxx
  client_secret: xxxxxxxxxxxxxxxxxxxxxxxxxx
  discovery: https://mydomain.com/auth/realms/master/.well-known/openid-configuration
  access_token_as_bearer: "yes"
  access_token_header_name: Authorization

Also tested without the two access_token_as_bearer and access_token_header_name that use X-Access-Token header without "bearer" string.

For reference, the configuration of jwt-keycloak plugin:

apiVersion: configuration.konghq.com/v1
kind: KongClusterPlugin
metadata:
  name: jwt-keycloak-sso
  annotations:
    kubernetes.io/ingress.class: kong
plugin: jwt-keycloak
config:
  cookie_names:
    - cookie_session
  allowed_iss:
    - https://mydomain.com/auth/realms/master
  header_names:
    - X-Access-Token
    - Authorization
  realm_roles:
    - a-role

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant