Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In function, Get-GoogleOAuth2Code, in help there is a parameter named client-secret. This is missing in actual parameters and in code. #2

Open
PramodKumarYadav opened this issue Jan 28, 2020 · 3 comments

Comments

@PramodKumarYadav
Copy link

I tried to run this code with the example mentioned but it doesnt work for me. I see that in the parameter list help there is a mention of client secret but it is not a part of actual code in this function. Is this okay?

@hakenmt
Copy link
Contributor

hakenmt commented Jan 28, 2020

Sorry, I just tested this and can see it's broken. I just tested this code about 2 months ago and it worked. At a first glance it looks like Google has changed how they respond to the initial request, so I'll need to troubleshoot what changed.

@hakenmt
Copy link
Contributor

hakenmt commented Jan 29, 2020

It looks like fairly recently Google made a breaking change to the behavior of the API. It used to return a redirect that you could trap and examine the redirected location and then open that uri in a browser to get the access code that could then be exchanged for tokens. Now it returns a 200 and just gives you the web page which makes it a little harder to open up in a browser. I don't really maintain this much anymore and google now provides a number of SDKs for these interactions (but not powershell). What are you trying to achieve with the module, that may help me figure out whether there's an easy fix or change to accomplish what you want to do.

@PramodKumarYadav
Copy link
Author

Some background: I was making a tool to analyze my phone call logs (in pdf) using Powershell. So I take a pdf report in and get the phone numbers and frequencies (done).
With Google API, I am getting the contact names. However, to do this, apart from setting up the project in google to get the client id and client secret, I have to do one more extra manual step. i.e. to get a "refresh token using googles developer portal". Although I have to do it only once but it is one extra step for say a non-technical user.
The intention is to eliminate the need to do this "manual step to get refresh token". If I could get access tokens in runtime, using your code, then the user would not need to "manually provide this refresh token".
The link to my project is here: https://github.com/PramodKumarYadav/Circle

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

No branches or pull requests

2 participants