Skip to content

Allow oauth2 and openidconnect to coexist #37059

Closed

Description

@butonic

When enabling the oauth2 app and the openidconnect app at the same time the openidconnect app does not get a chance to authenticate the bearer token header when authenticating oidc auth tokens, because the oauth2 app will throw an exception while the Session checks the auth headers.

The IAuthModules (TokenAuthModule, OAuth2\AuthModule, OpenIdConnectAuthModule and BasicAuthModule) are built in a way to return null when they cannot authenticate a user. But they also throw exceptions, when something goes wrong.

An exception from the OAuth2 AuthModuleThis prevents the OpenIDConnectAuth Module the verify the Bearer token.

Also looking at the code flow it seems the Session relies on the BasicAuthModule to throw an exception in case it could not verify a user ... like a catch all. Because if no backend throws an exception the user will not be logged out... Which seems to be wrong?

Shouldnt the Session ignore all exceptions as long as one backend can authenticate the user (the Token / cookie / php session being one of them)? Or at least leave the user logged in as long as all auth modules agree on which user is logged in ...

Activity

  1. butonic commented on Mar 3, 2020

    @butonic
    ContributorAuthor
  2. mmattel commented on Mar 3, 2020

    @mmattel
    Contributor

    Closing because of fix ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions