Categories
Programación

Generate OAuth Key for Google API

ImageofGoogleLogin

Getting your OAuth Key for Google API is simple but the instructions on their web page is not.
In this particular case when you use Visual Studio and want to obtain the OAuth key of your application that is under development it can become a complicated task.

The truth is that it is not so complex but Google documentation is not the easiest to read and even in many blogs they omit these procedures.

Apparently, for some it seems all super obvious. In Visual Studio the OAuth key changes depending on the mode of the APP.

If it is an application that is being developed (Debug) the procedure is as follows:

The first thing is to find the route and know what your user is: C: Users/AppDataLocalXamarinMono for Androidebug.keystored

After this, we require the path where the keytool.exe program is stored.

In my case, I do not have JDK since I do not develop in Android Studio at the moment but JDR so my path is something like this:

C: \ Program Files \ Java \ jre1.8.0_231 \ bin \ keytool

The next step is to open the Windows CMD and navigate to the path where key tool is located. Then it is just a matter of running the command that Google reports on its API page, in my case it is as follows:

keytool -exportcert -keystore “Your Location for Androiddebug.keystore “ -list -v

CommandLine with Google API OAuth key generated

Google API

After running in the CMD something like what you see in the image will come out, remember that these key stores usually have a password, for example I did not put any.

And with this we copy the SHA1 and copy it in our Google API.

Important to note that a new ID with a validator is created for a user. But I will not touch this in this post.

If your application is already in the production phase (RELEASE) then the key route will no longer have the word debug before

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *