softspring/user-bundle

A complete user bundle

Maintainers

Package info

github.com/softspring/user-bundle

Type:symfony-bundle

pkg:composer/softspring/user-bundle

Statistics

Installs: 24 898

Dependents: 5

Suggesters: 1

Stars: 3

Open Issues: 2

v5.5.7 2025-10-20 13:28 UTC

This package is auto-updated.

Last update: 2026-05-06 11:53:10 UTC


README

Latest Stable Latest Unstable License PHP Version Downloads CI Coverage

A complete user bundle for Symfony applications, including user authentication flows, settings pages, invitations, and admin user management screens.

Armonic

This package is part of Armonic.

Documentation

Armonic Documentation

Optional Google Identity Platform Login

This bundle can render Google Sign-In on the login page and sync users with Google Identity Platform.

The feature is optional.

1. Add the optional fields to your user entity

Use the trait and interface only if you enable this feature.

use Softspring\UserBundle\Entity\GoogleIdentityPlatformTrait;
use Softspring\UserBundle\Model\GoogleIdentityPlatformAwareInterface;

class User extends UserModel implements GoogleIdentityPlatformAwareInterface
{
    use GoogleIdentityPlatformTrait;
}

You will usually also want these existing optional contracts:

  • UserIdentifierEmailInterface
  • NameSurnameInterface
  • UserLastLoginInterface
  • UserAvatarInterface
  • ConfirmableInterface

2. Import the routes you want to expose

Create a dedicated route import in your application:

_sfs_user_google_identity_platform:
    resource: '@SfsUserBundle/config/routing/login_google_identity_platform.yaml'
    prefix: /auth/google

With that prefix, the callback URL will be /auth/google/callback.

3. Enable the feature in sfs_user

sfs_user:
    login:
        google_identity_platform:
            enabled: true
            client_id: '%env(default::GOOGLE_CLIENT_ID)%'
            api_key: '%env(default::IDENTITY_PLATFORM_API_KEY)%'
            tenant_id: '%env(default::IDENTITY_PLATFORM_TENANT_ID)%'
            success_route: app_home
            failure_route: sfs_user_login

4. Configure Google

The Google OAuth web client must allow:

  • your login origin, for example https://example.test
  • the callback URL from the imported route, for example https://example.test/auth/google/callback

The client_id must be a Google web client id ending with .apps.googleusercontent.com.

Notes

  • The login page only renders the Google widget when the feature is enabled.
  • If the routes are not imported, the login page shows a warning instead of rendering a broken button.
  • The backend exchange uses IDENTITY_PLATFORM_API_KEY.
  • tenant_id is optional.

Contributing

See CONTRIBUTING.md.

Report issues and send Pull Requests

Security

See SECURITY.md.

License

This package is free and released under the AGPL-3.0 license.