Fix test
This commit is contained in:
parent
8544727be2
commit
f692c18b0a
2 changed files with 6 additions and 3 deletions
|
@ -35,6 +35,7 @@ type AuthRequest struct {
|
||||||
UserID string
|
UserID string
|
||||||
Scopes []string
|
Scopes []string
|
||||||
ResponseType oidc.ResponseType
|
ResponseType oidc.ResponseType
|
||||||
|
ResponseMode oidc.ResponseMode
|
||||||
Nonce string
|
Nonce string
|
||||||
CodeChallenge *OIDCCodeChallenge
|
CodeChallenge *OIDCCodeChallenge
|
||||||
|
|
||||||
|
@ -100,7 +101,7 @@ func (a *AuthRequest) GetResponseType() oidc.ResponseType {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AuthRequest) GetResponseMode() oidc.ResponseMode {
|
func (a *AuthRequest) GetResponseMode() oidc.ResponseMode {
|
||||||
return "" // we won't handle response mode in this example
|
return a.ResponseMode
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AuthRequest) GetScopes() []string {
|
func (a *AuthRequest) GetScopes() []string {
|
||||||
|
@ -154,6 +155,7 @@ func authRequestToInternal(authReq *oidc.AuthRequest, userID string) *AuthReques
|
||||||
UserID: userID,
|
UserID: userID,
|
||||||
Scopes: authReq.Scopes,
|
Scopes: authReq.Scopes,
|
||||||
ResponseType: authReq.ResponseType,
|
ResponseType: authReq.ResponseType,
|
||||||
|
ResponseMode: authReq.ResponseMode,
|
||||||
Nonce: authReq.Nonce,
|
Nonce: authReq.Nonce,
|
||||||
CodeChallenge: &OIDCCodeChallenge{
|
CodeChallenge: &OIDCCodeChallenge{
|
||||||
Challenge: authReq.CodeChallenge,
|
Challenge: authReq.CodeChallenge,
|
||||||
|
|
|
@ -1135,8 +1135,9 @@ func TestAuthResponseCode(t *testing.T) {
|
||||||
res: res{
|
res: res{
|
||||||
wantCode: http.StatusOK,
|
wantCode: http.StatusOK,
|
||||||
wantLocationHeader: "",
|
wantLocationHeader: "",
|
||||||
wantBody: "<!doctype html>\n<html>\n<head><meta charset=\"UTF-8\" /></head>\n<body onload=\"javascript:document.forms[0].submit()\">\n<form method=\"post\" action=\"https://example.com/callback\">\n<input type=\"hidden\" name=\"state\" value=\"state1\"/>\n<input type=\"hidden\" name=\"code\" value=\"id1\" />\n\n\n\n</form>\n</body>\n</html>",
|
wantBody: "<!doctype html>\n<html>\n<head><meta charset=\"UTF-8\" /></head>\n<body onload=\"javascript:document.forms[0].submit()\">\n<form method=\"post\" action=\"https://example.com/callback\">\n<input type=\"hidden\" name=\"state\" value=\"state1\"/>\n<input type=\"hidden\" name=\"code\" value=\"id1\" />\n\n\n\n\n</form>\n</body>\n</html>",
|
||||||
}},
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue