grav-plugin-login-oauth2 icon indicating copy to clipboard operation
grav-plugin-login-oauth2 copied to clipboard

Feature: Allow only one provider

Open an-ant0ni0 opened this issue 2 years ago • 4 comments

We have the use case where only a single provider is needed. We want to skip the provider's button and directly redirect to the provider.

We have added an option to change the flow without the post form in our own code and could provide an PR.

Is this a welcomed option for this plugin? Please, let me know.

an-ant0ni0 avatar May 19 '22 19:05 an-ant0ni0

You still need the button for that provider to let the users know what provider will be used to login. I think that the current approach is the best choice, though I don't think it's hard to create your own button which has already selected the provider.

I think that a template to this button (with a template param to pick up the option) would be a welcomed option.

PS. you still need the form to login, but it could be formatted as a single button..?

mahagr avatar May 20 '22 06:05 mahagr

We use a self hosted keycloak instance as identity provider together with the login-oauth2-extras plugin and do not let the user choose. With an option we set the provider to keycloak and do not need a login form in grav at all but redirect to the login form of keycloak.

So maybe this is a very special use case where only a single provider is required. Maybe others are interested in this?

an-ant0ni0 avatar May 20 '22 07:05 an-ant0ni0

Maybe help us to understand what you want by providing an image / screenshot?

mahagr avatar May 20 '22 09:05 mahagr

Thanks for your patience. A screenshot is not so easy because there are just redirects. On our grav homepage is a link to an internal site (with access.site.login: true). We do not redirect to the login form but directly to keycloak where the keycloak login form is shown. image After login, keycloak redirect to the internal grav page. In short: grav.example.com --> keycloak.example.com/realms/x/protocol/openid-connect/auth/... --> grav.example.com/internal-page

Hope this helps to understand our case.

an-ant0ni0 avatar May 25 '22 18:05 an-ant0ni0