How-To Guide for Creating Oauth credentials for Google Voice gvsip

Tutorial for Creating Oauth credentials for Google Voice gvsip

Created with pictures to make the process easier for those following my Freepbx asterisk gvsip ubuntu guide: How-To Guide for Google Voice with Freepbx 14 & asterisk gvsip, Ubuntu 18.04

RonR’s guide was used as a source: [Asterisk] OAuth 2.0 Support for Asterisk 13 or Asterisk 14 - VOIP Tech Chat | DSLReports Forums

I recommend using google chrome while following this guide, I also recommended being signed out of ALL accounts in the top right corner except for the one you are generating the tokens for. Using Firefox may result in getting a 400 error, stating that there is a “redirect_uri_mismatch” while trying to generate tokens.

Oath Credentials Creation

go to: https://console.developers.google.com/cloud-resource-manager
log in to google voice account
click CREATE PROJECT (then wait a minute, you can see progress in top right corner.)

Enter a project Name (gvsip or whatever)
click CREATE

02

go to: https://console.developers.google.com/apis/dashboard
Select Project at Top that you just created. (gvsip or whatever)
click credentials on left

click OAuth consent screen

enter product name (gvsip or whatever)
click save

click Create credentials
click OAuth client ID

select Web application
enter a Name (gvsip or whatever)
at Authorized redirect URIs enter: https://developers.google.com/oauthplayground
click Create button twice
IMPORTANT, make sure that the Authorized redirect URI actually saves. If editing an existing project, you may have trouble with getting the Authorized redirect URI to save, I discovered this the hard way. Try deleting your current oauth credentials, and if that fails then delete the entire project.

record Client ID and Secret

go to: https://developers.google.com/oauthplayground
click the gear icon in top right
check Use your own OAuth credentials
enter OAuth Client ID
enter OAuth Client secret
click Close
at Input your own scopes enter: https://www.googleapis.com/auth/googletalk
Click Authorize API
Sign in to google voice account again if it prompts you, then click Allow.

Click Exchange authorization code for tokens

Record Refresh token

Congratulations! You should now have your client ID, client Secret, and Refresh token recorded so that you can use them for Oauth login, good luck.

4 Likes

Thanks xekon for this detailed wiki on creating Oauth credentials AND for your how-to for setting up google voice on freepbx. I will try to follow your wiki on my raspberry pi 3B (I currently have raspbx but am planning to load raspian). I know raspian is Debian-based; do you think I could loosely follow your how-to to install asterisk and freepbx onto the “pi”?

I have been trying to generate google voice credentials, but each time I fill in the generated client ID and the client secret on OAuth 2.0 configuration, click “close” and add “https://www.googleapis.com/auth/googletalk” into the box asking for Input for my own scopes and click on “Authorize APIs”, Google sends me to web-page with a 400 error (Error: redirect_uri_mismatch; The redirect URI in the request, https://developers.google.com/oauthplayground, does not match the ones authorized for the OAuth client.). I have tried generating the credentials 3 times with the same result.

I would appreciate any suggestions that you might have.

Thanks again for all the work you have put in to enabling people to again get access to google voice. You are dedicating a lot of time for the benefit of others and your efforts are much appreciated.

Don M.

It is possible you could, one user @Lutiana attempted the same thing and ran into some issues, if you do solve any issues then be sure to post how you solved them.

A few small parts of my Ubuntu guide were actually created from Debian guides so it is certainly possible. You just might have to problem solve some things that you would not run into when following my guide using a fresh box and Ubuntu.

Also I know for a fact that Incredible PBX (by Wardmundy) has been setup on raspberry PI machines, but in his method I am pretty sure he installs asterisk 13 and freepbx 13, and then simply Applies the Patch Files.

In the Dslreports thread, I think a couple users have outlined how to apply the Patch file to an EXISTING install, that may end up being the simplest if you run into issues.

1 Like

Thanks, xekon, for your reply!! I definitely will give it a shot.

1 Like

Xekon, your instructions work perfectly – but I believe you must use Google Chrome. Every time I tried to get tokens using Firefox, I got a 400 error, stating that there is a “redirect_uri_mismatch”. When I tried generating tokens in Chrome, everything went very smoothly.

Thanks again for this great wiki!!

1 Like

Thank you for your find, I will make a note of it in the guide.

make sure you have no trailing slash in authorized URL
https://developers.google.com/oauthplayground
NOT https://developers.google.com/oauthplayground/

i also hit save button a bunch of times since it’s wonky