@@ -376,15 +376,18 @@ func (f *FakeIDP) authenticateBearerTokenRequest(t testing.TB, req *http.Request
376
376
return token , nil
377
377
}
378
378
379
- // authenticateOIDClientRequest enforces the client_id and client_secret are valid.
380
- func (f * FakeIDP ) authenticateOIDClientRequest (t testing.TB , req * http.Request ) (url.Values , error ) {
379
+ // authenticateOIDCClientRequest enforces the client_id and client_secret are valid.
380
+ func (f * FakeIDP ) authenticateOIDCClientRequest (t testing.TB , req * http.Request ) (url.Values , error ) {
381
381
t .Helper ()
382
382
383
383
if f .hookAuthenticateClient != nil {
384
384
return f .hookAuthenticateClient (t , req )
385
385
}
386
386
387
- data , _ := io .ReadAll (req .Body )
387
+ data , err := io .ReadAll (req .Body )
388
+ if ! assert .NoError (t , err , "read token request body" ) {
389
+ return nil , xerrors .Errorf ("authenticate request, read body: %w" , err )
390
+ }
388
391
values , err := url .ParseQuery (string (data ))
389
392
if ! assert .NoError (t , err , "parse token request values" ) {
390
393
return nil , xerrors .New ("invalid token request" )
@@ -491,7 +494,7 @@ func (f *FakeIDP) httpHandler(t testing.TB) http.Handler {
491
494
}))
492
495
493
496
mux .Handle (tokenPath , http .HandlerFunc (func (rw http.ResponseWriter , r * http.Request ) {
494
- values , err := f .authenticateOIDClientRequest (t , r )
497
+ values , err := f .authenticateOIDCClientRequest (t , r )
495
498
f .logger .Info (r .Context (), "HTTP Call Token" ,
496
499
slog .Error (err ),
497
500
slog .F ("values" , values .Encode ()),
0 commit comments