diff --git a/path_login_test.go b/path_login_test.go index cd4661fd..73042fcb 100644 --- a/path_login_test.go +++ b/path_login_test.go @@ -445,61 +445,6 @@ func testLogin_JWT(t *testing.T, jwks bool) { } } - // Test missing audience - { - - cfg := testConfig{ - jwks: jwks, - } - b, storage := setupBackend(t, cfg) - - cl := sqjwt.Claims{ - Subject: "r3qXcK2bix9eFECzsU3Sbmh0K16fatW6@clients", - Issuer: "https://team-vault.auth0.com/", - NotBefore: sqjwt.NewNumericDate(time.Now().Add(-5 * time.Second)), - Audience: sqjwt.Audience{"https://vault.plugin.auth.jwt.test"}, - } - - privateCl := struct { - User string `json:"https://vault/user"` - Groups []string `json:"https://vault/groups"` - }{ - "jeff", - []string{"foo", "bar"}, - } - - jwtData, _ := getTestJWT(t, ecdsaPrivKey, cl, privateCl) - - data := map[string]interface{}{ - "role": "plugin-test", - "jwt": jwtData, - } - - req := &logical.Request{ - Operation: logical.UpdateOperation, - Path: "login", - Storage: storage, - Data: data, - Connection: &logical.Connection{ - RemoteAddr: "127.0.0.1", - }, - } - - resp, err := b.HandleRequest(context.Background(), req) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("got nil response") - } - if !resp.IsError() { - t.Fatal("expected error") - } - if !strings.Contains(resp.Error().Error(), "no audiences bound to the role") { - t.Fatalf("unexpected error: %v", resp.Error()) - } - } - // test valid inputs { // run test with and without bound_cidrs configured