FriendsOfSymfony / FOSOAuthServerBundle

A server side OAuth2 Bundle for Symfony
1.09k stars 451 forks source link

Support authentication manager #685

Open iisisrael opened 2 years ago

iisisrael commented 2 years ago

Supports authentication listener creation when using Symfony's new authentication system.

# config/packages/security.yaml
security:
    enable_authenticator_manager: true

I didn't see any need to add to the config documentation. Whether you have the above config enabled or not, it just works (see SecurityExtension::createAuthenticationListeners()).

iisisrael commented 2 years ago

Still working on this. Adding an authenticator that manages authentication via the new Passport with user and credential badges.

iisisrael commented 2 years ago

Not sure about the user provider dependency injection yet, will be testing in the context of another app.

iisisrael commented 2 years ago

Token storage is already taken care of in AuthenticatorManager::handleAuthenticationSuccess() when ::executeAuthenticator() is absolutely sure everything is kosher, so the token storage dependency in the OAuthAuthenticator was not needed.

iisisrael commented 2 years ago

@deguif I noticed when testing this in an app that an unauthenticated request results in an AccessDeniedException rather than an AuthenticationCredentialsNotFoundException. Is this a result of other recent changes, or did I bork something here?

If you don't know off the top of your head, I can run the same test based on a different branch of our app.

vladimir-light commented 2 years ago

Does cleint_credentials/autherization_code grant work?

victormacko commented 2 years ago

@iisisrael was this work finished in the end by chance? ... was super keen to transition to Symfony v6 but can't without the new authentication system :/ Thanks for all your hard work btw, it's super appreciated!

iisisrael commented 2 years ago

@victormacko yes, at least for this PR, or until changes are requested. Feel free to contribute by forking my fork, and I'll pull any changes into here.

Some other Symfony 5.3 deprecation fixes were made on a fork off of this PR branch here.

iisisrael commented 1 year ago

Rebased to include commits "Remove support for Propel" and "Move Travis to GH Actions and fix CI builds".

iisisrael commented 1 year ago

Removing support of Symfony 5.1 and 5.2 as a result of ProxyManager dependency change for ClassGenerator.