1/******************************************************************************
2 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
3 */
4
5#pragma once
6
7#include <Quotient/jobs/basejob.h>
8
9namespace Quotient {
10
11/*! \brief Redirect the user's browser to the SSO interface.
12 *
13 * A web-based Matrix client should instruct the user's browser to
14 * navigate to this endpoint in order to log in via SSO.
15 *
16 * The server MUST respond with an HTTP redirect to the SSO interface,
17 * or present a page which lets the user select an IdP to continue
18 * with in the event multiple are supported by the server.
19 */
20class QUOTIENT_API RedirectToSSOJob : public BaseJob {
21public:
22 /*! \brief Redirect the user's browser to the SSO interface.
23 *
24 * \param redirectUrl
25 * URI to which the user will be redirected after the homeserver has
26 * authenticated the user with SSO.
27 */
28 explicit RedirectToSSOJob(const QString& redirectUrl);
29
30 /*! \brief Construct a URL without creating a full-fledged job object
31 *
32 * This function can be used when a URL for RedirectToSSOJob
33 * is necessary but the job itself isn't.
34 */
35 static QUrl makeRequestUrl(QUrl baseUrl, const QString& redirectUrl);
36};
37
38/*! \brief Redirect the user's browser to the SSO interface for an IdP.
39 *
40 * This endpoint is the same as `/login/sso/redirect`, though with an
41 * IdP ID from the original `identity_providers` array to inform the
42 * server of which IdP the client/user would like to continue with.
43 *
44 * The server MUST respond with an HTTP redirect to the SSO interface
45 * for that IdP.
46 */
47class QUOTIENT_API RedirectToIdPJob : public BaseJob {
48public:
49 /*! \brief Redirect the user's browser to the SSO interface for an IdP.
50 *
51 * \param idpId
52 * The `id` of the IdP from the `m.login.sso` `identity_providers`
53 * array denoting the user's selection.
54 *
55 * \param redirectUrl
56 * URI to which the user will be redirected after the homeserver has
57 * authenticated the user with SSO.
58 */
59 explicit RedirectToIdPJob(const QString& idpId, const QString& redirectUrl);
60
61 /*! \brief Construct a URL without creating a full-fledged job object
62 *
63 * This function can be used when a URL for RedirectToIdPJob
64 * is necessary but the job itself isn't.
65 */
66 static QUrl makeRequestUrl(QUrl baseUrl, const QString& idpId,
67 const QString& redirectUrl);
68};
69
70} // namespace Quotient
71