Skip to content
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

Instead of adding additional logins via php api - this can perfectly … #27607

Merged
merged 3 commits into from
May 15, 2017

Conversation

DeepDiver1975
Copy link
Member

@DeepDiver1975 DeepDiver1975 commented Apr 10, 2017

…be done via the config as well

Screenshots (if appropriate):

bildschirmfoto von 2017-04-10 10-14-27

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@@ -146,7 +146,12 @@ public function showLoginForm($user, $redirect_url, $remember_login) {
}
}

$parameters['alt_login'] = OC_App::getAlternativeLogIns();
$altLogins = OC_App::getAlternativeLogIns();
$altLogins2 = $this->config->getSystemValue('login.alternatives');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add to config.sample.php

@PVince81
Copy link
Contributor

👍

@PVince81
Copy link
Contributor

Failing tests:

10:39:16 1) Tests\Core\Controller\LoginControllerTest::testShowLoginFormWithPasswordResetOption with data set #0 (true, true)
10:39:16 OCP\IConfig::getSystemValue('login.alternatives', '') was not expected to be called more than once.
10:39:16 
10:39:16 /var/lib/jenkins/workspace/owncloud-core_core_PR-27607-WK4NWSBUHCZGNS5OJCGIPJE5RNXHDVGK7VCLROJOBTRLQP6HBOYQ/core/Controller/LoginController.php:150
10:39:16 /var/lib/jenkins/workspace/owncloud-core_core_PR-27607-WK4NWSBUHCZGNS5OJCGIPJE5RNXHDVGK7VCLROJOBTRLQP6HBOYQ/tests/Core/Controller/LoginControllerTest.php:240
10:39:16 
10:39:16 2) Tests\Core\Controller\LoginControllerTest::testShowLoginFormWithPasswordResetOption with data set #1 (false, false)
10:39:16 OCP\IConfig::getSystemValue('login.alternatives', '') was not expected to be called more than once.
10:39:16 
10:39:16 /var/lib/jenkins/workspace/owncloud-core_core_PR-27607-WK4NWSBUHCZGNS5OJCGIPJE5RNXHDVGK7VCLROJOBTRLQP6HBOYQ/core/Controller/LoginController.php:150
10:39:16 /var/lib/jenkins/workspace/owncloud-core_core_PR-27607-WK4NWSBUHCZGNS5OJCGIPJE5RNXHDVGK7VCLROJOBTRLQP6HBOYQ/tests/Core/Controller/LoginControllerTest.php:240
10:39:16 
10:39:16 3) Tests\Core\Controller\LoginControllerTest::testShowLoginFormForUserNamedNull
10:39:16 OCP\IConfig::getSystemValue('login.alternatives', '') was not expected to be called more than once.
10:39:16 
10:39:16 /var/lib/jenkins/workspace/owncloud-core_core_PR-27607-WK4NWSBUHCZGNS5OJCGIPJE5RNXHDVGK7VCLROJOBTRLQP6HBOYQ/core/Controller/LoginController.php:150
10:39:16 /var/lib/jenkins/workspace/owncloud-core_core_PR-27607-WK4NWSBUHCZGNS5OJCGIPJE5RNXHDVGK7VCLROJOBTRLQP6HBOYQ/tests/Core/Controller/LoginControllerTest.php:279

* Allows to specify additional login buttons on the logon screen for e.g. SSO integration
* 'login.alternatives' => [
* ['href' => '/sso-saml', 'name' => 'Shibboleth SSO', 'img' => '/img/shibboleth.png'],
* ['href' => '/sso-adfs', 'name' => 'ADFS'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very bad example: ADFS and Shibboleth are both doing SAML. The use cases out there are showing buttons for different IdPs. The links then go directly to the idp. on oic side the same /login/saml url is protected by mod_shib. It is configured to handle multiple idps with dedicated SessionInitiators, see https://wiki.shibboleth.net/confluence/display/CONCEPT/IdPDiscovery#IdPDiscovery-AttheApplication

<a href="https://www.testshib.org/Shibboleth.sso/ProtectNetwork?target=https%3A%2F%2Fwww.testshib.org%2Ftestshib-two%2Fauth-pages%2Fauth.jsp">
   <img src="images/PN_sign-in.gif" alt="Login with ProtectNetwork" border="0">
</a>
 
<a href="https://www.testshib.org/Shibboleth.sso/OpenIdP.org?target=https%3A%2F%2Fwww.testshib.org%2Ftestshib-two%2Fauth-pages%2Fauth.jsp">
   <img src="images/openidp.png" alt="Login with OpenIdP.org" border="0">
</a>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it

* Allows to specify additional login buttons on the logon screen for e.g. SSO integration
*	'login.alternatives' => [
*    ['href' => 'https://www.testshib.org/Shibboleth.sso/ProtectNetwork?target=https%3A%2F%2Fmy.owncloud.tld%2Flogin%2Fsso-saml%2F', 'name' => 'ProtectNetwork', 'img' => '/img/PN_sign-in.gif'],
*    ['href' => 'https://www.testshib.org/Shibboleth.sso/OpenIdP.org?target=https%3A%2F%2Fmy.owncloud.tld%2Flogin%2Fsso-saml%2F', 'name' => 'OpenIdP.org'], 'img' => '/img/openidp.png'],

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to change this to something more reasonable @butonic

@DeepDiver1975 DeepDiver1975 force-pushed the additional-logins-in-config.php branch from c11dc5a to 65c833f Compare April 10, 2017 13:38
@@ -203,6 +203,15 @@
'token_auth_enforced' => false,

/**
* Allows to specify additional login buttons on the logon screen for e.g. SSO integration
* 'login.alternatives' => [
* 'login.alternatives' => [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

207 === 208

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:wtf?:

* 'login.alternatives' => [
* ['href' => 'https://www.testshib.org/Shibboleth.sso/ProtectNetwork?target=https%3A%2F%2Fmy.owncloud.tld%2Flogin%2Fsso-saml%2F', 'name' => 'ProtectNetwork', 'img' => '/img/PN_sign-in.gif'],
* ['href' => 'https://www.testshib.org/Shibboleth.sso/OpenIdP.org?target=https%3A%2F%2Fmy.owncloud.tld%2Flogin%2Fsso-saml%2F', 'name' => 'OpenIdP.org'], 'img' => '/img/openidp.png'],
* * ]
Copy link
Member

@butonic butonic Apr 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* *

@DeepDiver1975 DeepDiver1975 force-pushed the additional-logins-in-config.php branch from 65c833f to 2663456 Compare April 10, 2017 14:21
* ]
*/
'login.alternatives' => [],
/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing newline for clarity

@PVince81 PVince81 modified the milestones: 10.0.1, 10.0 Apr 26, 2017
@PVince81
Copy link
Contributor

PVince81 commented May 4, 2017

With only one option it doesn't look good, needs some centering:
alt-login

@DeepDiver1975 DeepDiver1975 force-pushed the additional-logins-in-config.php branch from 2663456 to 513363b Compare May 12, 2017 09:56
@DeepDiver1975
Copy link
Member Author

With only one option it doesn't look good, needs some centering:

maybe @felixheidecke can apply some css magic

@PVince81
Copy link
Contributor

I'll just add "text-align: center". As easy as that:
buttonzzz

@PVince81
Copy link
Contributor

Here you go: 67486aa

That's just CSS magic level 0

@DeepDiver1975 DeepDiver1975 merged commit 45cfc02 into master May 15, 2017
@DeepDiver1975 DeepDiver1975 deleted the additional-logins-in-config.php branch May 15, 2017 09:51
@lock
Copy link

lock bot commented Aug 3, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants