Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Antonyco50's avatar

Best way to authenticate using google? (Gsuite)

Up until now I have mostly relied on laravel's built in authentication. I have simple 'asset tracking' web app that allows admin users to track company equipment (eg computers assigned to employees). It works great with laravel's built in authentication, but all the user management (users, roles, permissions) is done from within the app. We'd like to authenticate using google, so that only google accounts within our gsuite domain can access it without having to use a separate login/password.

I'v spent about 2 hours reading through different google docs and I'm still confused. Does anyone know how to best approach it? Any tutorials or guides to recommend? I don't even know where to being researching. SAML? O Auth? Google Sign-in?

0 likes
2 replies
Antonyco50's avatar

Thanks, I didn't realize I could use socialite. It made it way easier than I thought it was going to be. I restricted access to just our company domain using:

if (! ends_with($user->email, '@company.com')) {
    abort(403);
}
1 like

Please or to participate in this conversation.