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

[Do not Submit] Reproduce Jwt Authn Unknown issuer #473

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/env/testdata/fake_jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ const (
"2MKZxKsYn8NRVpdyy39Bp3IUv9AUbk4qEKB69pbfSt5H2Z6P_waYfv6m-GieQZWGlhO90Y" +
"ytoPuPekKhe8JVV2f5yCwLE89S9ZD8779_1G4UGOsyBfxGvOicoZ9nqtGbJYHnqMN3gjh-" +
"BWr3cm9Mswm8TCkP0Lv2cvQ"
// ./gen-jwt.py key.pem -jwks=./jwks.json --expire=3153600000 --iss="unknown_jwks_provider" --aud bookstore_test_client.cloud.goog
FakeUnknownIssuerToken = "eyJhbGciOiJSUzI1NiIsImtpZCI6IkRIRmJwb0lVcXJZOHQyenBBMnFYZkNtcjVWTzVaRXI0UnpIVV8tZW52dlEiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOiJib29rc3RvcmVfdGVzdF9jbGllbnQuY2xvdWQuZ29vZyIsImV4cCI6NDc2NTgwMjQwMSwiaWF0IjoxNjEyMjAyNDAxLCJpc3MiOiJ1bmtub3duX2p3a3NfcHJvdmlkZXIiLCJzdWIiOiJ1bmtub3duX2p3a3NfcHJvdmlkZXIifQ.QyIM87k4eRfvnWQ3VVFo7Jp5shgW63NAW_vw-jQBT8LyNbGUkKti0C2FQuiNhuTuZjfPN6ABocCihF0zOm5IvsaZ09XyWPB8cdoW7Pb9aTupsVf6VrWdQ_9xuJPD5gDvN0K1XdW6JWQM3Xnte-IAiUkhPKlzoMCz4PE275Uz1U-uk_YED4qkT2-HL-SB24oXUfJcEspSjazCV9Xbw9GmZ8F5PVGoIkK7jrpVHpPCWauUmA2CQx4tmVJ2_P3Ou91VCQtalzbqQF45HLXyPgUMtxDo6oDBc9SLWOUCv1qeSUzrLrlFe1jTmyKELwl1k06N1749AG0sXW55tv5w1Q7ytw"

// ./gen-jwt.py key.pem -jwks=jwks.json --expire=3153600000 --iss=http://127.0.0.1:32025 --aud=ok_audience
FakeOpenIDToken = "eyJhbGciOiJSUzI1NiIsImtpZCI6IkRIRmJwb0lV" +
Expand Down
9 changes: 9 additions & 0 deletions tests/integration_test/jwt_auth_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,15 @@ func TestAsymmetricKeys(t *testing.T) {
token: testdata.FakeNonexistJwksProviderToken,
wantError: `401 Unauthorized, {"code":401,"message":"Jwks remote fetch is failed"}`,
},
// TODO(b/179038530): should return `JwtUnknownIssuer`
{
desc: "Failed, misleading error message(JWT is missing) on Jwt signed by an unknown issue",
clientProtocol: "http",
httpMethod: "GET",
method: "/v1/shelves?key=api-key",
token: testdata.FakeUnknownIssuerToken,
wantError: `401 Unauthorized, {"code":401,"message":"Jwt is missing"}`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you can reproduce this error?

How is the envoy jwt_authn config look like?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. You found the problem.

},
{
desc: "Succeeded, using OpenID Connect Discovery",
clientProtocol: "http",
Expand Down