# Login with Google V2

**URL:** <https://community.thunkable.com/t/login-with-google-v2/4826>\
**Category:** Promote your App\
**Tags:** google, oauth, aia, login\
**Created:** [June 25, 2017, 1:55pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826 "2017-06-25T13:55:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barreeeiroo](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/barreeeiroo/32/17867_2.png) [@Barreeeiroo](https://community.thunkable.com/u/Barreeeiroo)\
**Post date:** [June 25, 2017, 1:55pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/1 "2017-06-25T13:55:55Z")

</div>

Hi there 👋  
Here is the new version of my _Login with Google_ method

The other one is not working as Google blocks WebViewer since months ago

* * *

#Setup

Setup instructions can be found in original topic

> [@Login with Google - Thunkable/AppInventor](http://community.thunkable.com/t/login-with-google-thunkable-appinventor/348/):
>
> Hi everyone wave As I promished yesterday, here it is an example of GoogleLogin with OAuth in AppInventor or Thunkable: First of all, you must know that it uses a webserver, but it’s not compulsory because I don’t mind to share mine It uses Google+ API, so the app doesn’t need any additional permissions #Setup ####Google Developer Console optional Register a new project in [Google Developers Console](https://console.developers.google.com/iam-admin/projects) Enable Google+ API (in [Home](https://console.developers.google.com/apis/dashboard)\>[Library](https://console.developers.google.com/apis/library)\>Social Api\>[Google+ API](https://console.developers.google.com/apis/api/plus/overview)) …

* * *

#How to manage data

Probably the most wanted and difficult feature

To get user’s data, first you need to authenticate them

1. For that, use a WebViewer that uses [EWV extension](http://community.thunkable.com/t/extended-web-viewer-extension/4564/) to enale OAuth or a [WVD extension](http://community.thunkable.com/t/releasing-the-web-viewer-dialog-extension/3956/)
2. After enabling it, make the WebView to go to this URL: [https://scripts.thunkable.ga/google/oauth/](https://scripts.thunkable.ga/google/oauth/)  
It will create a Google OAuth page
3. Use a Clock to detect when the `CurrentPageTitle` goes to _Logged in_; because when you get that it’s because you have full access to user’s data
4. Now, to get user’s data, just make a WebView to go to this URL: [https://scripts.thunkable.ga/google/oauth/?data=sth](https://scripts.thunkable.ga/google/oauth/?data=sth)  
Change the sth to what you want. The avaliable params can be found in the list of the app
5. And get the `CurrentPageTitle` to get that info

To logout users, just go to [https://scripts.thunkable.ga/google/oauth/?logout](https://scripts.thunkable.ga/google/oauth/?logout)

Of course, if you are using your own web server, use your URL instead of mine

  

You can also take a look to the app code to see how I’m managing data

If you are planning to use this for loging or signing users you will probably need the email

* * *

#Files

- Google OAuth .ZIP: [OAuth.zip](https://drive.google.com/file/d/0B_-a6i4oQMHfTWJyaUpWQjhlZFU/view?usp=sharing) (20 MB)

- Google OAuth .AIA: [OAuth.aia](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/2X/b/bb2b1f2b4c60c5130609a921760ccb290e52972d.aia) (67.1 KB)

- Google OAuth .APK: [OAuth.apk](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/2X/3/3debfaee6c311e4d89894d9001e0d93079ece928.apk) (2.3 MB)

* * *

#Screenshots

 ![](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/2X/f/f0d4becebff410fc9c125bae559d2128bf229bfb.jpg) ![](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/2X/7/77f4185be788f67e887a79a4b63f5c0aa492a0c9.jpg) ![](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/2X/6/60f057ebfc96cecca373e3273caec20c723d482a.jpg) ![](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/2X/4/425eb0e05c9daa7bf2aa47fbf14f13ebdf28532f.jpg)

 ![](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/2X/4/4eeec8bbe38e879ba9193dd9e71d58d7b1287c4a.png)

 ![](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/2X/4/4ee1b078fb48fd4454900d853995a615e7ab1411.png)

* * *

If you have any question or doubt, just ask 😉

---

<div class="post-metadata">

**Author:** ![Ali\_Aydin](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ali_aydin/32/7989_2.png) [@Ali\_Aydin](https://community.thunkable.com/u/Ali_Aydin)\
**Post date:** [June 28, 2017, 7:45pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/2 "2017-06-28T19:45:19Z")

</div>

Unable download or test it because your website suspended.

Can you upload them to other location like google drive or dropbox

---

<div class="post-metadata">

**Author:** ![Barreeeiroo](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/barreeeiroo/32/17867_2.png) [@Barreeeiroo](https://community.thunkable.com/u/Barreeeiroo)\
**Post date:** [June 28, 2017, 8:54pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/3 "2017-06-28T20:54:14Z")

</div>

The website will be online again in 15 hours

I can’t download it too, but when it becames online again I will re-upload the files to GoogleDrive

---

<div class="post-metadata">

**Author:** ![Ali\_Aydin](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ali_aydin/32/7989_2.png) [@Ali\_Aydin](https://community.thunkable.com/u/Ali_Aydin)\
**Post date:** [June 29, 2017, 9:48pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/4 "2017-06-29T21:48:30Z")

</div>

Unable download file

[https://scripts.thunkable.ga/google/oauth/oauth.zip](https://scripts.thunkable.ga/google/oauth/oauth.zip)

Error 404

---

<div class="post-metadata">

**Author:** ![Ali\_Aydin](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ali_aydin/32/7989_2.png) [@Ali\_Aydin](https://community.thunkable.com/u/Ali_Aydin)\
**Post date:** [June 30, 2017, 5:20pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/5 "2017-06-30T17:20:30Z")

</div>

I found [one.Is](http://one.Is) it true file?

[barreeeiroo.ga/es/appinventor/googleauth/googleauth.zip](http://barreeeiroo.ga/es/appinventor/googleauth/googleauth.zip)

---

<div class="post-metadata">

**Author:** ![Barreeeiroo](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/barreeeiroo/32/17867_2.png) [@Barreeeiroo](https://community.thunkable.com/u/Barreeeiroo)\
**Post date:** [June 30, 2017, 6:29pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/6 "2017-06-30T18:29:38Z")

</div>

Nope, that’s the old one

Now I’m on a trip  
When I get home I will upload the correct one to GDrive

---

<div class="post-metadata">

**Author:** ![Barreeeiroo](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/barreeeiroo/32/17867_2.png) [@Barreeeiroo](https://community.thunkable.com/u/Barreeeiroo)\
**Post date:** [June 30, 2017, 9:28pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/7 "2017-06-30T21:28:06Z")

</div>

Here it is:  
[https://drive.google.com/file/d/0B\_-a6i4oQMHfTWJyaUpWQjhlZFU/view?usp=sharing](https://drive.google.com/file/d/0B_-a6i4oQMHfTWJyaUpWQjhlZFU/view?usp=sharing)

I will update the link on the first post too

---

<div class="post-metadata">

**Author:** ![Ali\_Aydin](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ali_aydin/32/7989_2.png) [@Ali\_Aydin](https://community.thunkable.com/u/Ali_Aydin)\
**Post date:** [July 1, 2017, 9:51pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/8 "2017-07-01T21:51:41Z")

</div>

Thanks succesfuly work

Can i get mutliple information about user with one request  
I try name&email but its not work

---

<div class="post-metadata">

**Author:** ![Barreeeiroo](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/barreeeiroo/32/17867_2.png) [@Barreeeiroo](https://community.thunkable.com/u/Barreeeiroo)\
**Post date:** [July 1, 2017, 10:41pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/9 "2017-07-01T22:41:30Z")

</div>

Use two WebComponents, save the first output in a variable and then join it with the second response

---

<div class="post-metadata">

**Author:** ![Ali\_Aydin](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ali_aydin/32/7989_2.png) [@Ali\_Aydin](https://community.thunkable.com/u/Ali_Aydin)\
**Post date:** [July 4, 2017, 4:55pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/10 "2017-07-04T16:55:29Z")

</div>

I found easy way to get all data

Just used userinfo.profile scope

![](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/2X/7/74061ccdffe73509f1d8ee9d0ff5fce52aea522a.PNG)

---

<div class="post-metadata">

**Author:** ![Barreeeiroo](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/barreeeiroo/32/17867_2.png) [@Barreeeiroo](https://community.thunkable.com/u/Barreeeiroo)\
**Post date:** [July 4, 2017, 4:58pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/11 "2017-07-04T16:58:04Z")

</div>

Ehem… 😅

It’s because you are setting a parameter that it’s not defined  
If you set an unknow param it returns all information

Try these examples to test it:  
[https://scripts.thunkable.ga/google/oauth/?data=](https://scripts.thunkable.ga/google/oauth/?data=)  
[https://scripts.thunkable.ga/google/oauth/?data=lol](https://scripts.thunkable.ga/google/oauth/?data=lol)  
[https://scripts.thunkable.ga/google/oauth/?data=userinfo.profile](https://scripts.thunkable.ga/google/oauth/?data=userinfo.profile)

---

<div class="post-metadata">

**Author:** ![Ali\_Aydin](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ali_aydin/32/7989_2.png) [@Ali\_Aydin](https://community.thunkable.com/u/Ali_Aydin)\
**Post date:** [July 4, 2017, 5:05pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/12 "2017-07-04T17:05:16Z")

</div>

Hahaha 🙂

Do you know how can i copy informations to variable.I m unable find it

---

<div class="post-metadata">

**Author:** ![Barreeeiroo](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/barreeeiroo/32/17867_2.png) [@Barreeeiroo](https://community.thunkable.com/u/Barreeeiroo)\
**Post date:** [July 4, 2017, 5:05pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/13 "2017-07-04T17:05:46Z")

</div>

What do you mean?

---

<div class="post-metadata">

**Author:** ![Ali\_Aydin](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ali_aydin/32/7989_2.png) [@Ali\_Aydin](https://community.thunkable.com/u/Ali_Aydin)\
**Post date:** [July 4, 2017, 5:07pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/14 "2017-07-04T17:07:45Z")

</div>

I want store users informations on list.And store list using tinydb or other storage companents

Webview show user informations but i cant find way copy it to variable or list

---

<div class="post-metadata">

**Author:** ![Barreeeiroo](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/barreeeiroo/32/17867_2.png) [@Barreeeiroo](https://community.thunkable.com/u/Barreeeiroo)\
**Post date:** [July 4, 2017, 5:09pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/15 "2017-07-04T17:09:10Z")

</div>

The `WebView.Title` block gives you the output  
Just join it with a variable or whatever

---

<div class="post-metadata">

**Author:** ![Ali\_Aydin](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ali_aydin/32/7989_2.png) [@Ali\_Aydin](https://community.thunkable.com/u/Ali_Aydin)\
**Post date:** [July 4, 2017, 5:14pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/16 "2017-07-04T17:14:13Z")

</div>

Did you test it with no parameter(userinfo.profile),Its work for id,email or other parameters but not work for my method

---

<div class="post-metadata">

**Author:** ![Barreeeiroo](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/barreeeiroo/32/17867_2.png) [@Barreeeiroo](https://community.thunkable.com/u/Barreeeiroo)\
**Post date:** [July 4, 2017, 5:18pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/17 "2017-07-04T17:18:19Z")

</div>

I hadn’t thought about how to handle it…  
I just added that function thinking about using it visually 😅

I will add it to the WebView.Title tomorrow too so

---

<div class="post-metadata">

**Author:** ![Ali\_Aydin](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ali_aydin/32/7989_2.png) [@Ali\_Aydin](https://community.thunkable.com/u/Ali_Aydin)\
**Post date:** [July 4, 2017, 5:23pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/18 "2017-07-04T17:23:32Z")

</div>

Okey waiting for it.If you can send changed file its better for me because already uploaded files and ı dont want reupload same files (its takes more time)

---

<div class="post-metadata">

**Author:** ![Barreeeiroo](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/barreeeiroo/32/17867_2.png) [@Barreeeiroo](https://community.thunkable.com/u/Barreeeiroo)\
**Post date:** [July 4, 2017, 5:24pm UTC](https://community.thunkable.com/t/login-with-google-v2/4826/19 "2017-07-04T17:24:28Z")

</div>

I can’t do it now, I’m a bit busy

I will do it in 16 hours more or less

---

<div class="post-metadata">

**Author:** ![Ali\_Aydin](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ali_aydin/32/7989_2.png) [@Ali\_Aydin](https://community.thunkable.com/u/Ali_Aydin)\
**Post date:** [July 10, 2017, 10:57am UTC](https://community.thunkable.com/t/login-with-google-v2/4826/20 "2017-07-10T10:57:18Z")

</div>

Any news?

[Next page](https://community.thunkable.com/t/login-with-google-v2/4826.md?page=2)
