Search code examples
phpsymfonyoauthfosoauthserverbundlesymfony-3.2

How to get AuthorizationCode GrantType working in Symfony 3 with FOSOAuthServerBundle


i'm trying to build a Bootstrap for a Symfony3 REST-Application with OAuth2 Support based on FOSOAuth. My current Implementation is based on the following Sources:

  1. git:maxpou docker-symfony for Docker Setup
  2. symfony.com - CustomUserProvider for own Userprovider
  3. cause your stuck - oauth2 explained for OAuth Configuration
  4. bitgandtter.blog - A restful app for OAuth in Symfony

and can be found here with all Setupsteps described inside the Readme.

The Client Credentials Login is working right now, but i've got Problems with the AuthorizationCode Flow which does not redirect to client.local like described in cause your stuck - AuthorizationCode and instead redirects to the auth_login-Route again. I thought that FOSOAuth is catching the request and redirects it to client.local

Because there are so many Components involved in this i resign on posting code snippets and kindly refer to the git repository

Thanks in advance for any help provided!


Solution

    1. I had an error in my UserGeneration Algorithm which generated a wrong PasswordHash because i passed in the email as password and visa versa.
    2. i tried to use the security.context-Service which is deprecated since Symfony 2.6

    The current Bootstrap now works!