Appearance
Google sign-in
"Continue with Google" lets visitors sign in or sign up with their Google account. Setup is free and takes about 15 minutes in the Google Cloud Console.
You need
A Google account to own the project (use a company account, not a personal one), your live domain on https, and access to the server's .env.
Create a Google Cloud project
- Open console.cloud.google.com and sign in.
- Click the project picker at the top → New project.
- Name it after your exchange (for example
YourExchange Sign-in) → Create, then make sure it is selected in the project picker.
Set up the consent screen
This is the window users see when Google asks "Sign in to YourExchange".
- Go to APIs & Services → OAuth consent screen (in newer consoles: Google Auth Platform → Branding). Click Get started if asked.
- App name: your exchange name. User support email: your support address.
- Audience / User type: External (anyone with a Google account).
- Contact information: an email for Google's notices → Create.
- Under Branding, add your logo, Application home page (
https://yourdomain.com), Privacy policy (https://yourdomain.com/privacy-gdpror your own page) and Terms of service links, and under Authorized domains addyourdomain.com. Save. - Under Data access / Scopes you don't need to add anything: the site asks only for the basic
openid,emailandprofilescopes, which need no Google review. - Under Audience, click Publish app so the status is In production.
Don't leave it in Testing
While the app is in Testing, only the Google accounts listed as test users can sign in; everyone else sees "Access blocked". With only the basic scopes, publishing needs no verification by Google.
Create the OAuth client
Go to APIs & Services → Credentials (or Google Auth Platform → Clients) → Create credentials → OAuth client ID.
Application type: Web application. Name:
Website.Authorized JavaScript origins: not needed, leave empty.
Authorized redirect URIs → Add URI:
texthttps://yourdomain.com/login/google/callbackIt must match exactly:
https, with or withoutwwwas in yourAPP_URL, no trailing slash. If the site answers on bothyourdomain.comandwww.yourdomain.com, add both, but redirect visitors to one of them.Create. Copy the Client ID (ends in
.apps.googleusercontent.com) and the Client secret (starts withGOCSPX-). Keep the secret private.
The mobile app uses the same web client and the same redirect URI. You don't need Android or iOS clients.
Fill in .env
ini
GOOGLE_CLIENT_ID=1234567890-abc123.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxxxxxxx
GOOGLE_REDIRECT_URI=https://yourdomain.com/login/google/callbackGOOGLE_REDIRECT_URI must be exactly the address you added in the console. .env.example has http://localhost/..., so change it. Then:
bash
php artisan config:clearTest it
- Open
https://yourdomain.com/loginin a private window → click the Google button. - Choose a Google account. The first time, Google shows the consent screen with your app name.
- You come back signed in (or on the two-factor step if that account has 2FA).
- Try it in the app too: Sign in → Google. The app opens the browser and returns by itself.
An existing account with the same email is signed in, and Google is connected to it. Users can also connect Google later under Connected accounts.
Common errors
| What you see | Cause and fix |
|---|---|
| Google page: Error 400: redirect_uri_mismatch | The URI in GOOGLE_REDIRECT_URI is not in the client's Authorized redirect URIs (often http vs https or www). Make them identical, then config:clear. |
| Google page: Access blocked: … has not completed the Google verification process | The consent screen is still in Testing. Publish it. |
| Google page: Error 401: invalid_client | Wrong or old GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET, or config:clear not run. |
| Our page: Google authentication failed. | The site couldn't finish the sign-in. Most often the session cookie was lost between leaving and coming back (the visitor started on http, or on another domain than APP_URL), or the secret is wrong. Check storage/logs/laravel-YYYY-MM-DD.log. |
| Our page: A referral code is required to register. | Referral required is on and the visitor came without a referral link. Expected. |
Turning it off
The website always shows the Google button. To stop offering Google, remove the button from resources/js/Themes/prime/Web/Pages/Auth/Login.template and Register.template and rebuild the assets. In the app the button disappears when GOOGLE_CLIENT_ID is empty.
