diff --git a/lib/client.js b/lib/client.js index 5726fa489..310da7815 100644 --- a/lib/client.js +++ b/lib/client.js @@ -1728,6 +1728,31 @@ MatrixClient.prototype.loginWithSAML2 = function(relayState, callback) { }, callback); }; +/** + * @param {module:client.callback} callback Optional. + * @return {module:client.Promise} Resolves: TODO + * @return {module:http-api.MatrixError} Rejects: with an error response. + */ +MatrixClient.prototype.getCasServer = function(callback) { + return this._http.authedRequest( + callback, "GET", "/login/cas", undefined, undefined + ); +}; + +/** + * @param {string} ticket (Received from CAS) + * @param {string} service Service to which the token was granted + * @param {module:client.callback} callback Optional. + * @return {module:client.Promise} Resolves: TODO + * @return {module:http-api.MatrixError} Rejects: with an error response. + */ +MatrixClient.prototype.loginWithCas = function(ticket, service, callback) { + return this.login("m.login.cas", { + ticket: ticket, + service: service + }, callback); +}; + // Push operations // ===============