I am trying to validate JWT Token with oauth2-proxy and Azure AD (multi tenant). The setup is working and I can log in via http://localhost:4180
. This is how I run the proxy:
docker run --net=host quay.io/oauth2-proxy/oauth2-proxy:latest \
--provider=oidc \
--oidc-issuer-url=https://login.microsoftonline.com/organizations/v2.0 \
--insecure-oidc-skip-issuer-verification=true \
--scope=[REDACTED] \
--oidc-email-claim=preferred_username \
--email-domain="*" \
--client-secret=[REDACTED] \
--client-id=[REDACTED] \
--cookie-secret=[REDACTED] \
--redirect-url="http://localhost:8080" \
--pass-access-token=true \
--pass-authorization-header=true \
--upstream=file:///dev/null \
--pass-user-headers=true \
--auth-logging=true \
--standard-logging=true \
--request-logging=true
I made a small NextJS application with React MSAL so I can get my JWT token. I even verified it at https://jwt.io and everything looks okay.
Problem occurs when I want to check validity of token. I send a request to http://localhost:4180/oauth2/auth
via Insomnia and add the Authorization
: Bearer <token>
header, but I constantly get 401.
How can I get 202 and the token accepted? What am I doing wrong? I can not any information as to what oauth2/auth
expects from me. Again, I am certain the token is valid, but I do not know how to pass it to oauth2/auth
.
I am open to any solutions to validate this JWT token. I just want to either get 202 or 401. The final solution will be connected to nginx.