Webmasters Asked by Andrei Botalov on November 3, 2021
My app contains Sign in from Google function that uses Oauth. To test it I’d want to create test accounts at Google. But Google doesn’t allow me to create ordinary accounts without entering captcha so I can’t create ordinary accounts for testing.
Can I create test accounts in Google to test Oauth in my application?
You can create a google account and configure a simple project/client within googles cloud console. Then you can configure it for oauth and use googles oauth-playground for creating a refresh-token (which never expires).
With your client-id, client-secret and the refresh-token you can send a post-request in your tests to googles auth-token endpoint (https://www.googleapis.com/oauth2/v4/token
) and will receive a valid (short-time) access-token. No manual steps needed here.
I've read about it in this guide.
Answered by Sola Tis on November 3, 2021
Like Stephen Ostermiller suggests you can make a seperate test account. In addition you can change or revoke the app access in your Sign-in & security settings in your desired google account. This is what I use to test different functionality of my Google+ integration. I think that is the most easy option since Google does not have any sandbox accounts as far as I know.
Answered by user1643134 on November 3, 2021
I usually create a single test account and use it over and over again rather than create a new account each time the test is run. I don't know of any way to create a Google account using automated test scripts.
The alternative would be to build a backdoor into your application login. Something that creates a test account on your site without using Google login that can be used by your test scripts but which is not available to users on your site.
Answered by Stephen Ostermiller on November 3, 2021
In Google using GMail, you can use dots to make multiple email accounts that all reroute to your main email account. Here are the directions from Google's Help Reference.
Answered by TBRM 1 on November 3, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP