Skip to content

Commit

Permalink
test: add tdd test
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-elliott committed Aug 30, 2023
1 parent 4273501 commit 63c797c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions integration/oidc_explicit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,21 @@ func TestOpenIDConnectExplicitFlow(t *testing.T) {
},
authStatusCode: http.StatusOK,
},
{
session: newIDSession(&jwt.IDTokenClaims{
Subject: "peter",
RequestedAt: time.Now().UTC(),
AuthTime: time.Now().Add(time.Second).UTC(),
}),
description: "should not pass missing redirect uri",
setup: func(oauthClient *oauth2.Config) string {
oauthClient.RedirectURL = ""
oauthClient.Scopes = []string{"openid"}
return oauthClient.AuthCodeURL("12345678901234567890") + "&nonce=1234567890&prompt=login"
},
expectAuthErr: `{"error":"invalid_request","error_description":"The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. The 'redirect_uri' parameter is required when using OpenID Connect 1.0."}`,
authStatusCode: http.StatusBadRequest,
},
{
session: newIDSession(&jwt.IDTokenClaims{
Subject: "peter",
Expand Down

0 comments on commit 63c797c

Please sign in to comment.