examples: fix OAuth client example after latest changes. (#820)

This commit is contained in:
Maciej Kisiel 2026-02-27 17:04:25 +01:00 • committed by GitHub
commit 83f7e968f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -53,6 +53,7 @@ func (r *codeReceiver) serveRedirectHandler(listener net.Listener) {
}
func (r *codeReceiver) getAuthorizationCode(ctx context.Context, args *auth.AuthorizationArgs) (*auth.AuthorizationResult, error) {
fmt.Printf("Please open the following URL in your browser: %s\n", args.URL)
select {
case authRes := <-r.authChan:
return authRes, nil
@ -87,8 +88,10 @@ func main() {
AuthorizationCodeFetcher: receiver.getAuthorizationCode,
// Uncomment the client configuration you want to use.
// PreregisteredClientConfig: &auth.PreregisteredClientConfig{
// ClientID: "",
// ClientSecret: "",
// ClientSecretAuthConfig: &auth.ClientSecretAuthConfig{
// ClientID: "",
// ClientSecret: "",
// },
// },
// DynamicClientRegistrationConfig: &auth.DynamicClientRegistrationConfig{
// Metadata: &oauthex.ClientRegistrationMetadata{