examples: fix OAuth client example after latest changes. (#820)
This commit is contained in:
parent
c9317fb5b7
commit
83f7e968f8
1 changed files with 5 additions and 2 deletions
|
|
@ -53,6 +53,7 @@ func (r *codeReceiver) serveRedirectHandler(listener net.Listener) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *codeReceiver) getAuthorizationCode(ctx context.Context, args *auth.AuthorizationArgs) (*auth.AuthorizationResult, error) {
|
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 {
|
select {
|
||||||
case authRes := <-r.authChan:
|
case authRes := <-r.authChan:
|
||||||
return authRes, nil
|
return authRes, nil
|
||||||
|
|
@ -87,8 +88,10 @@ func main() {
|
||||||
AuthorizationCodeFetcher: receiver.getAuthorizationCode,
|
AuthorizationCodeFetcher: receiver.getAuthorizationCode,
|
||||||
// Uncomment the client configuration you want to use.
|
// Uncomment the client configuration you want to use.
|
||||||
// PreregisteredClientConfig: &auth.PreregisteredClientConfig{
|
// PreregisteredClientConfig: &auth.PreregisteredClientConfig{
|
||||||
// ClientID: "",
|
// ClientSecretAuthConfig: &auth.ClientSecretAuthConfig{
|
||||||
// ClientSecret: "",
|
// ClientID: "",
|
||||||
|
// ClientSecret: "",
|
||||||
|
// },
|
||||||
// },
|
// },
|
||||||
// DynamicClientRegistrationConfig: &auth.DynamicClientRegistrationConfig{
|
// DynamicClientRegistrationConfig: &auth.DynamicClientRegistrationConfig{
|
||||||
// Metadata: &oauthex.ClientRegistrationMetadata{
|
// Metadata: &oauthex.ClientRegistrationMetadata{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue