yii2-authclient icon indicating copy to clipboard operation
yii2-authclient copied to clipboard

Skip login page if there is only one authentication client

Open azmeuk opened this issue 4 years ago • 7 comments

Hi. I have one unique OIDC authentication client with my humhub installation, and this will not change in the future. Thus, displaying the regular signin form is useless for me and I would like to skip this screen and automatically redirect to my OIDC provider login page. I could not find documentation about this.

Is there a way to achieve this? If not, I suggest implementing this feature.

What do you think?

azmeuk avatar Nov 18 '21 13:11 azmeuk

There's currently no way to achieve it. We won't likely work on it ourselves but will gladly accept a pull request implementing it.

samdark avatar Nov 21 '21 13:11 samdark

Ok I may try to look at this then. Before I start, do you have clues or expectations on how this should be done?

azmeuk avatar Nov 21 '21 15:11 azmeuk

  1. It should be optional and turned off by default.
  2. If there is a single client, no choice screen should be displayed and auth should be performed for that client right away.

samdark avatar Nov 21 '21 16:11 samdark

Is a javascript redirection OK or do you prefer the redirection being made serverside?

azmeuk avatar Dec 16 '21 13:12 azmeuk

We prefer it serverside.

samdark avatar Dec 16 '21 13:12 samdark

I could find a workaround with a bit of configuration:

$config = [
    ...
    'components' => [
        ...
         'users' => [
            ...
            'enableAutoLogin': true,
            'loginUrl' => ['/user/auth/external?authclient=MyAuthClient'],
         ]
    ]
];

azmeuk avatar Jan 13 '22 11:01 azmeuk

If it could be achieved without coding, it should be in the readme.

samdark avatar Jan 14 '22 20:01 samdark