Skip to content

Login button doesn't appear when OAuth used with Authchained plugin #174

@philpem

Description

@philpem

Issue Description

When used with Authchained or a subclassed OAuth plugin, the "Login with (oauth provider)" button doesn't appear on the Login form.

My use case is that I have two routes for authentication (one is used for API requests). I initially used the Chained Auth plugin to run both - but later I changed to making my auth plugin inherit from the OAuth plugin and had the same issue.

The root cause is that the Action plugin (which adds the login button) tries to be clever and figure out if the OAuth plugin is the active auth plugin, but doesn't account for chained or subclassed auth plugins:

global $conf;
if ($conf['authtype'] != 'oauth') return;

I'm happy to do the dev work on this but I can see a couple of ways to deal with this and wanted to know what would be preferred if I opened a PR:

  • Specifically detect whether Authchained is in use, and if so, check whether "oauth" is included in Authchained's auth plugins list.
  • Add a config option to OAuth to force the Login button to always appear, overriding this check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions