@@ -429,7 +429,11 @@ func buildAuthHeader(config *oidcv1.OIDCConfig) (http.Header, error) {
429
429
// TODO: implement private key jwt auth header
430
430
return nil , errors .New ("client authentication method private_key_jwt is not implemented" )
431
431
default :
432
- return nil , errors .New ("client authentication requires at least one authentication method" )
432
+ // Builds basic auth header
433
+ headers = http.Header {
434
+ inthttp .HeaderContentType : []string {inthttp .HeaderContentTypeFormURLEncoded },
435
+ inthttp .HeaderAuthorization : []string {inthttp .BasicAuthHeader (config .GetClientId (), config .GetClientSecret ())},
436
+ }
433
437
}
434
438
435
439
return headers , nil
@@ -464,12 +468,23 @@ func buildAuthParams(config *oidcv1.OIDCConfig, codeFromReq string, codeVerifier
464
468
// Build jwt auth params
465
469
// TODO: implement jwt auth params
466
470
return nil , errors .New ("client authentication method client_secret_jwt is not implemented" )
471
+
467
472
case oidcv1 .OIDCConfig_CLIENT_AUTHENTICATION_METHOD_PRIVATE_KEY_JWT :
468
473
// Build private key jwt auth params
469
474
// TODO: implement private key jwt auth params
470
475
return nil , errors .New ("client authentication method private_key_jwt is not implemented" )
476
+
471
477
default :
472
- return nil , errors .New ("client authentication requires at least one authentication method" )
478
+
479
+ // Build basic auth params
480
+ params = url.Values {
481
+ "grant_type" : []string {"authorization_code" },
482
+ "code" : []string {codeFromReq },
483
+ "redirect_uri" : []string {config .GetCallbackUri ()},
484
+ "code_verifier" : []string {codeVerifierFromReq },
485
+ }
486
+
487
+ return params , nil
473
488
}
474
489
return params , nil
475
490
}
0 commit comments