| 1 | /****************************************************************************** |
| 2 | * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN |
| 3 | */ |
| 4 | |
| 5 | #pragma once |
| 6 | |
| 7 | #include <Quotient/csapi/definitions/openid_token.h> |
| 8 | |
| 9 | #include <Quotient/jobs/basejob.h> |
| 10 | |
| 11 | namespace Quotient { |
| 12 | |
| 13 | /*! \brief Get an OpenID token object to verify the requester's identity. |
| 14 | * |
| 15 | * Gets an OpenID token object that the requester may supply to another |
| 16 | * service to verify their identity in Matrix. The generated token is only |
| 17 | * valid for exchanging for user information from the federation API for |
| 18 | * OpenID. |
| 19 | * |
| 20 | * The access token generated is only valid for the OpenID API. It cannot |
| 21 | * be used to request another OpenID access token or call `/sync`, for |
| 22 | * example. |
| 23 | */ |
| 24 | class QUOTIENT_API RequestOpenIdTokenJob : public BaseJob { |
| 25 | public: |
| 26 | /*! \brief Get an OpenID token object to verify the requester's identity. |
| 27 | * |
| 28 | * \param userId |
| 29 | * The user to request an OpenID token for. Should be the user who |
| 30 | * is authenticated for the request. |
| 31 | * |
| 32 | * \param body |
| 33 | * An empty object. Reserved for future expansion. |
| 34 | */ |
| 35 | explicit RequestOpenIdTokenJob(const QString& userId, |
| 36 | const QJsonObject& body = {}); |
| 37 | |
| 38 | // Result properties |
| 39 | |
| 40 | /// OpenID token information. This response is nearly compatible with the |
| 41 | /// response documented in the |
| 42 | /// [OpenID Connect 1.0 |
| 43 | /// Specification](http://openid.net/specs/openid-connect-core-1_0.html#TokenResponse) |
| 44 | /// with the only difference being the lack of an `id_token`. Instead, |
| 45 | /// the Matrix homeserver's name is provided. |
| 46 | OpenIdCredentials tokenData() const |
| 47 | { |
| 48 | return fromJson<OpenIdCredentials>(json: jsonData()); |
| 49 | } |
| 50 | }; |
| 51 | |
| 52 | } // namespace Quotient |
| 53 | |