You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: jwt-test
config:
secret_is_base64: false
run_on_preflight: true
plugin: jwt
curl -i -X POST http://kong-admin:8001/services --data name=test_service --data url="??????";
curl -i -X POST http://kong-admin:8001/services/test_service/routes --data ??????
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kong-ingress-jwt
annotations:
konghq.com/strip-path: 'true'
konghq.com/plugins: jwt-test
spec:
ingressClassName: kong
tls:
- hosts:
- kong.example.com
secretName: test-cert
rules:
- host: kong.example.com
http:
paths:
- path: /ep-jwt
pathType: ImplementationSpecific
backend:
service:
name: kong-proxy
port:
number: 80
kubectl get node -o wide provides INTERNAL-IP
Added in /etc/hosts: kong.example.com
Then the api call to route i.e http://kong.example.com:NODEPORT/ep-jwt/ROUTE works fine with JWT Bearer token.
But if I change the ingress (path /ep-jwt to /):
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: edge-kong-ingress-jwt
annotations:
konghq.com/strip-path: 'true'
konghq.com/plugins: jwt-test
spec:
ingressClassName: kong
tls:
- hosts:
- kong.example.com
secretName: test-cert
rules:
- host: kong.example.com
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: kong-proxy
port:
number: 80
Then the API call to route i.e http://kong.example.com:NODEPORT/ROUTE returns Bad Request
I tried both strip-path true and false.
Any guideline what I am missing?
Beta Was this translation helpful? Give feedback.
All reactions