Skip to content

Conversation

@ixiumu
Copy link

@ixiumu ixiumu commented Sep 2, 2019

No description provided.

@jhanley-com
Copy link
Owner

I just noticed your pull request tonight.

Thank you very much. I have also been making a large number of improvements but I have not completed any commits because of the large number of new features and bug fixes.

Starting tomorrow, I will begin integrating your improvements with mine. I am very interested in your work on Visual Code with Cloud Shell.

Thank you.

John

Copy link
Owner

@jhanley-com jhanley-com left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please incorporate these changes to your code.

diff --git a/auth.go b/auth.go
index 73e0ee6..84ce9cc 100644
--- a/auth.go
+++ b/auth.go
@@ -569,7 +569,7 @@ func get_tokens() (string, string, error) {

auth_code := string(out)
  • return processAuthCode(secrets, auth_code)
  • return processAuthCode(secrets, auth_code, false)
    }

func get_sa_tokens() (string, string, error) {
@@ -647,16 +647,20 @@ func manualAuthentication(secrets ClientSecrets, url string) (string, string, er

auth_code := strings.Replace(text, "\n", "", -1)
  • return processAuthCode(secrets, auth_code)
  • return processAuthCode(secrets, auth_code, true)
    }

-func processAuthCode(secrets ClientSecrets, auth_code string) (string, string, error) {
+func processAuthCode(secrets ClientSecrets, auth_code string, flag_oob bool) (string, string, error) {
//************************************************************
content := "client_id=" + secrets.Installed.ClientID
content += "&client_secret=" + secrets.Installed.ClientSecret
content += "&code=" + auth_code
content += "&grant_type=authorization_code"

  • content += "&redirect_uri=urn:ietf:wg:oauth:2.0:oob"
  • if flag_oob == false {

  •   content += "&redirect_uri=http://localhost:9000"
    
  • } else {

  •   content += "&redirect_uri=urn:ietf:wg:oauth:2.0:oob"
    
  • }
    //************************************************************

    endpoint := "https://www.googleapis.com/oauth2/v4/token"

Copy link
Owner

@jhanley-com jhanley-com left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I integrated these changes with my changes in commit bdff83f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants