FOSOAuthServerBundle icon indicating copy to clipboard operation
FOSOAuthServerBundle copied to clipboard

Support authentication manager

Open iisisrael opened this issue 3 years ago • 10 comments

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 avatar Oct 26 '21 13:10 iisisrael

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

iisisrael avatar Oct 26 '21 20:10 iisisrael

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

iisisrael avatar Oct 27 '21 00:10 iisisrael

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 avatar Oct 28 '21 01:10 iisisrael

@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.

iisisrael avatar Oct 29 '21 17:10 iisisrael

Does cleint_credentials/autherization_code grant work?

vladimir-light avatar May 19 '22 07:05 vladimir-light

@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!

victormacko avatar Jun 09 '22 05:06 victormacko

@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 avatar Jun 09 '22 15:06 iisisrael

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

iisisrael avatar Sep 01 '22 18:09 iisisrael

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

iisisrael avatar Sep 09 '22 23:09 iisisrael