1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-18 05:42:00 +03:00

Add client functions around new synapse CAS login

This commit is contained in:
Steven Hammerton
2015-10-08 22:22:29 +01:00
parent 79db25b131
commit c22382360b

View File

@@ -1728,6 +1728,31 @@ MatrixClient.prototype.loginWithSAML2 = function(relayState, callback) {
}, 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 // Push operations
// =============== // ===============