cdaecke / md_saml

TYPO3 SSO Login with SAML authentication
Other
2 stars 8 forks source link

Possibility to change default login #30

Closed DerVolli closed 2 months ago

DerVolli commented 2 months ago

Hi,

is it possible to switch the default login provider? By default I get username/password while I strongly prefer to get the view with the SAML login provider (i.e. view with "Single Sign-on with SAML" and Sign-On-Button). (I know that i could remove username/password - but I want to keep both!)

Best regards, Stefan Beck

DerVolli commented 2 months ago

Nevermind - found out myself:

see the setup.typoscript:

[....] // If you need to specify requested attributes, set a // attributeConsumingService. nameFormat, attributeValue and // friendlyName can be omitted. Otherwise remove this section. attributeConsumingService { isDefault = true, serviceName = SP MdSaml, serviceDescription = SAML Service of ext:md_saml requestedAttributes { 10 { name = emailAddress isRequired = false nameFormat = urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified friendlyName = mail attributeValue = typo3@uni-passau.de } } } [...]

DerVolli commented 2 months ago

Sorry, was not the solution. Still get the username/password mask first

cdaecke commented 2 months ago

Frontend login: https://github.com/cdaecke/md_saml/blob/e76f25d487616061102cce41aba32eebfb409478/Readme.md?plain=1#L49-L52

TYPO3 login https://github.com/cdaecke/md_saml/blob/e76f25d487616061102cce41aba32eebfb409478/Readme.md?plain=1#L239-L245

Does this answer your question?

DerVolli commented 2 months ago

No it does not - I do not want to remove username/passwort just that SAML is standard.

Am Dienstag, 23. April 2024 um 12:39:46 MESZ hat chris ***@***.***> Folgendes geschrieben:  

Frontend login: https://github.com/cdaecke/md_saml/blob/e76f25d487616061102cce41aba32eebfb409478/Readme.md?plain=1#L49-L52

TYPO3 login https://github.com/cdaecke/md_saml/blob/e76f25d487616061102cce41aba32eebfb409478/Readme.md?plain=1#L239-L245

Does this answer your question?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

cdaecke commented 2 months ago

So you are talking about the backend login?

This can be changed with adding the following line in the ext_localconf.php of your own extension:

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['loginProviders'][1648123062]['sorting'] = 60;

DerVolli commented 2 months ago

Yes. The BE login. I added the line - but no effect. We are using btw version 2.0.0 as we still have Typo3 10.4.44 This is our ext_localconf.php: <?php defined('TYPO3') or die();

call_user_func(function () {     /*      Register the auth service      */     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService(         'md_saml',         'auth',         \Mediadreams\MdSaml\Authentication\SamlAuthService::class,         [             'title' => 'BE ADFS Authentication',             'description' => 'Authentication with a Microsoft ADFS',             'subtype' => 'authUserFE, getUserFE, authUserBE, getUserBE',             'available' => true,             'priority' => 80,             'quality' => 80,             'os' => '',             'exec' => '',             'className' => \Mediadreams\MdSaml\Authentication\SamlAuthService::class         ]     );

    $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['loginProviders'][1648123062] = [         'provider' => \Mediadreams\MdSaml\LoginProvider\SamlLoginProvider::class,         'sorting' => 50,         'icon-class' => 'fa-sign-in',         'label' => 'LLL:EXT:md_saml/Resources/Private/Language/locallang.xlf:login.md_saml'     ];

    $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['loginProviders'][1648123062]['sorting'] = 60;

}); require \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('md_saml') . 'Resources/Libraries/vendor/autoload.php';

Am Mittwoch, 24. April 2024 um 06:33:27 MESZ hat chris ***@***.***> Folgendes geschrieben:  

So you are talking about the backend login?

This can be changed with adding the following line in the ext_localconf.php of your own extension:

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['loginProviders'][1648123062]['sorting'] = 60;

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

cdaecke commented 2 months ago

Did you clear the TYPO3 cache?

DerVolli commented 2 months ago

No - but this helped, thanks a lot! Now it can be really closed ;)

Am Mittwoch, 24. April 2024 um 08:15:24 MESZ hat chris ***@***.***> Folgendes geschrieben:  

Did you clear the TYPO3 cache?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>