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

Projects
None yet
3 participants
@DeepDiver1975
Member

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.

@DeepDiver1975 DeepDiver1975 added this to the 10.0 milestone Apr 10, 2017

@DeepDiver1975 DeepDiver1975 requested review from PVince81 and butonic Apr 10, 2017

@@ -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');

This comment has been minimized.

@PVince81

PVince81 Apr 10, 2017

Member

please add to config.sample.php

@PVince81

PVince81 Apr 10, 2017

Member

please add to config.sample.php

@PVince81

This comment has been minimized.

Show comment
Hide comment
@PVince81

PVince81 Apr 10, 2017

Member

👍

Member

PVince81 commented Apr 10, 2017

👍

@PVince81

This comment has been minimized.

Show comment
Hide comment
@PVince81

PVince81 Apr 10, 2017

Member

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
Member

PVince81 commented Apr 10, 2017

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
Show outdated Hide outdated config/config.sample.php
* 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'],

This comment has been minimized.

@butonic

butonic Apr 10, 2017

Member

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>
@butonic

butonic Apr 10, 2017

Member

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>

This comment has been minimized.

@butonic

butonic Apr 10, 2017

Member

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'],
@butonic

butonic Apr 10, 2017

Member

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'],

This comment has been minimized.

@DeepDiver1975

DeepDiver1975 Apr 10, 2017

Member

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

@DeepDiver1975

DeepDiver1975 Apr 10, 2017

Member

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

Show outdated Hide outdated config/config.sample.php
@@ -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' => [

This comment has been minimized.

@butonic

butonic Apr 10, 2017

Member

207 === 208

@butonic

butonic Apr 10, 2017

Member

207 === 208

This comment has been minimized.

@DeepDiver1975

DeepDiver1975 Apr 10, 2017

Member

:wtf?:

@DeepDiver1975
Show outdated Hide outdated config/config.sample.php
* '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'],
* * ]

This comment has been minimized.

@butonic

butonic Apr 10, 2017

Member

* *

@butonic

butonic Apr 10, 2017

Member

* *

Show outdated Hide outdated config/config.sample.php
* ]
*/
'login.alternatives' => [],
/**

This comment has been minimized.

@butonic

butonic Apr 11, 2017

Member

missing newline for clarity

@butonic

butonic Apr 11, 2017

Member

missing newline for clarity

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

@PVince81

This comment has been minimized.

Show comment
Hide comment
@PVince81

PVince81 May 4, 2017

Member

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

Member

PVince81 commented May 4, 2017

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

DeepDiver1975 added some commits Apr 10, 2017

@DeepDiver1975

This comment has been minimized.

Show comment
Hide comment
@DeepDiver1975

DeepDiver1975 May 12, 2017

Member

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

maybe @felixheidecke can apply some css magic

Member

DeepDiver1975 commented May 12, 2017

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

maybe @felixheidecke can apply some css magic

@PVince81

This comment has been minimized.

Show comment
Hide comment
@PVince81

PVince81 May 15, 2017

Member

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

Member

PVince81 commented May 15, 2017

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

@PVince81

This comment has been minimized.

Show comment
Hide comment
@PVince81

PVince81 May 15, 2017

Member

Here you go: 67486aa

That's just CSS magic level 0

Member

PVince81 commented May 15, 2017

Here you go: 67486aa

That's just CSS magic level 0

@DeepDiver1975 DeepDiver1975 merged commit 45cfc02 into master May 15, 2017

1 of 4 checks passed

Scrutinizer Running
Details
continuous-integration/jenkins/pr-head This commit is being built
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
license/cla Contributor License Agreement is signed.
Details

@DeepDiver1975 DeepDiver1975 deleted the additional-logins-in-config.php branch May 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment