Skip to content

Single SSO Mode #1584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Valinwolf opened this issue May 4, 2025 · 1 comment
Open

Single SSO Mode #1584

Valinwolf opened this issue May 4, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@Valinwolf
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
When is SSO only mode and only one SSO is configured, you still have to click an extra button.

Describe the solution you'd like
A clear and concise description of what you want to happen.
Either a setting for "Single SSO Mode" -or- when only one SSO is configured and "SSO only mode" is on, the login page is skipped on the click of the login button and it goes directly to the configured SSO.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Creating a fork and adding the feature myself, until I realized even though I know PHP twig is nearly it's own language and I was definitely lost in the sauce and eventually threw in the towel.

Additional context
Add any other context or screenshots about the feature request here.
N/A

@Valinwolf Valinwolf added the enhancement New feature or request label May 4, 2025
@Valinwolf
Copy link
Author

I don't know how helpful this would be, but in LoginSocialsComponent.php could have a function for checking if only one SSO is configured:

public function singleSSO(): bool
{
    $ssos = array(googleEnabled(), discordEnabled(), facebookEnabled(), githubEnabled(), privacyPortalEnabled(), keycloakEnabled(), simpleloginEnabled(), zitadelEnabled(), authentikEnabled(), azureEnabled());
    $counts = array_count_values($ssos);
    return if($counts[true]==1);
}

Some pseudo-code for the end of login.html.twig could maybe be:

{% if mbin_sso_only_mode() and component('login_socials')->singleSSO() %}
<script type="text/javascript">
$('.social > .btn').click();
</script>
{% endif %}

but I have no idea how twig works, so I wouldn't know if that is even possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant