Category: oauth-2.0

How to get Google refresh token with knpuniversity/oauth2-client-bundle?

I use knpuniversity/oauth2-client-bundle and league/oauth2-google to connect users in my Symfony 4 web app using a “Sign in with Google” feature. I followed this tuto. I registered my app in Google. I set access_type: offline in the knpu.oauth2.client.google configuration (config/packages/knpu_oauth2_client.yaml…

How to retrieve username after authentication is successful?

I am using Gitlab authentication in my current symfony project. I am using following two packages. omines/oauth2-gitlab knpuniversity/oauth2-client-bundle Inside my security.yaml file security: # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers providers: app_user_provider: id: AppSecurityUserProvider firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false main: anonymous: true guard: authenticators:…