Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Fix: Update drive quickstart authorization code flow #88

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions drive/quickstart/quickstart.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ func getClient(config *oauth2.Config) *http.Client {
// Request a token from the web, then returns the retrieved token.
func getTokenFromWeb(config *oauth2.Config) *oauth2.Token {
authURL := config.AuthCodeURL("state-token", oauth2.AccessTypeOffline)
fmt.Printf("Go to the following link in your browser then type the "+
"authorization code: \n%v\n", authURL)
fmt.Printf("Go to the following link in your browser: "+
"\n%v\n\nEnter the authorization code below. If the last page errors you can find the auth code as the query param 'code' of the final oAuth page URL", authURL)

fmt.Println("\n\nAuthorization Code:")
var authCode string
if _, err := fmt.Scan(&authCode); err != nil {
log.Fatalf("Unable to read authorization code %v", err)
Expand Down