diff --git a/res/css/structures/login/_Login.scss b/res/css/structures/login/_Login.scss
index 84b8306a74..1264d2a30f 100644
--- a/res/css/structures/login/_Login.scss
+++ b/res/css/structures/login/_Login.scss
@@ -142,6 +142,17 @@ limitations under the License.
color: $primary-fg-color;
}
+.mx_Login_sso_link {
+ display: block;
+ text-align: center;
+ font-size: 15px;
+ margin-bottom: 20px;
+}
+
+.mx_Login_sso_link:link {
+ color: $primary-fg-color;
+}
+
.mx_Login_loader {
display: inline;
position: relative;
diff --git a/src/Login.js b/src/Login.js
index 61a14959d8..ec55a1e8c7 100644
--- a/src/Login.js
+++ b/src/Login.js
@@ -16,7 +16,6 @@ limitations under the License.
*/
import Matrix from "matrix-js-sdk";
-import { _t } from "./languageHandler";
import Promise from 'bluebird';
import url from 'url';
@@ -225,19 +224,18 @@ export default class Login {
});
}
- redirectToCas() {
+ getSsoLoginUrl(loginType) {
const client = this._createTemporaryClient();
const parsedUrl = url.parse(window.location.href, true);
// XXX: at this point, the fragment will always be #/login, which is no
// use to anyone. Ideally, we would get the intended fragment from
// MatrixChat.screenAfterLogin so that you could follow #/room links etc
- // through a CAS login.
+ // through an SSO login.
parsedUrl.hash = "";
parsedUrl.query["homeserver"] = client.getHomeserverUrl();
parsedUrl.query["identityServer"] = client.getIdentityServerUrl();
- const casUrl = client.getCasLoginUrl(url.format(parsedUrl));
- window.location.href = casUrl;
+ return client.getSsoLoginUrl(url.format(parsedUrl), loginType);
}
}
diff --git a/src/components/structures/login/Login.js b/src/components/structures/login/Login.js
index 45f523f141..92cddb0dc1 100644
--- a/src/components/structures/login/Login.js
+++ b/src/components/structures/login/Login.js
@@ -84,7 +84,10 @@ module.exports = React.createClass({
// letting you do that login type
this._stepRendererMap = {
'm.login.password': this._renderPasswordStep,
- 'm.login.cas': this._renderCasStep,
+
+ // CAS and SSO are the same thing, modulo the url we link to
+ 'm.login.cas': () => this._renderSsoStep(this._loginLogic.getSsoLoginUrl("cas")),
+ 'm.login.sso': () => this._renderSsoStep(this._loginLogic.getSsoLoginUrl("sso")),
};
this._initLoginLogic();
@@ -186,10 +189,6 @@ module.exports = React.createClass({
}).done();
},
- onCasLogin: function() {
- this._loginLogic.redirectToCas();
- },
-
_onLoginAsGuestClick: function() {
const self = this;
self.setState({
@@ -403,10 +402,9 @@ module.exports = React.createClass({
);
},
- _renderCasStep: function() {
- const CasLogin = sdk.getComponent('login.CasLogin');
+ _renderSsoStep: function(url) {
return (
-