|
|
|
@ -461,7 +461,7 @@ Password-based
|
|
|
|
|
:Type:
|
|
|
|
|
``m.login.password``
|
|
|
|
|
:Description:
|
|
|
|
|
The client submits a username and secret password, both sent in plain-text.
|
|
|
|
|
The client submits an identifier and secret password, both sent in plain-text.
|
|
|
|
|
|
|
|
|
|
To use this authentication type, clients should submit an auth dict as follows:
|
|
|
|
|
|
|
|
|
@ -469,7 +469,26 @@ To use this authentication type, clients should submit an auth dict as follows:
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"type": "m.login.password",
|
|
|
|
|
"user": "<user_id or user localpart>",
|
|
|
|
|
"identifier": {
|
|
|
|
|
...
|
|
|
|
|
},
|
|
|
|
|
"password": "<password>",
|
|
|
|
|
"session": "<session ID>"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
where the ``identifier`` property is a user identifier object, as described in
|
|
|
|
|
`Identifier types`_.
|
|
|
|
|
|
|
|
|
|
For example, to authenticate using the user's Matrix ID, clients whould submit:
|
|
|
|
|
|
|
|
|
|
.. code:: json
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"type": "m.login.password",
|
|
|
|
|
"identifier": {
|
|
|
|
|
"type": "m.id.user",
|
|
|
|
|
"user": "<user_id or user localpart>"
|
|
|
|
|
},
|
|
|
|
|
"password": "<password>",
|
|
|
|
|
"session": "<session ID>"
|
|
|
|
|
}
|
|
|
|
@ -482,8 +501,11 @@ follows:
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"type": "m.login.password",
|
|
|
|
|
"medium": "<The medium of the third party identifier. Must be 'email'>",
|
|
|
|
|
"address": "<The third party address of the user>",
|
|
|
|
|
"identifier": {
|
|
|
|
|
"type": "m.id.thirdparty",
|
|
|
|
|
"medium": "<The medium of the third party identifier.>",
|
|
|
|
|
"address": "<The third party address of the user>"
|
|
|
|
|
},
|
|
|
|
|
"password": "<password>",
|
|
|
|
|
"session": "<session ID>"
|
|
|
|
|
}
|
|
|
|
@ -714,6 +736,78 @@ handle unknown login types:
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Identifier types
|
|
|
|
|
++++++++++++++++
|
|
|
|
|
|
|
|
|
|
Some authentication mechanisms use a user identifier object to identify a
|
|
|
|
|
user. The user identifier object has a ``type`` field to indicate the type of
|
|
|
|
|
identifier being used, and depending on the type, has other fields giving the
|
|
|
|
|
information required to identify the user as described below.
|
|
|
|
|
|
|
|
|
|
This specification defines the following identifier types:
|
|
|
|
|
- ``m.id.user``
|
|
|
|
|
- ``m.id.thirdparty``
|
|
|
|
|
- ``m.id.phone``
|
|
|
|
|
|
|
|
|
|
Matrix User ID
|
|
|
|
|
<<<<<<<<<<<<<<
|
|
|
|
|
:Type:
|
|
|
|
|
``m.id.user``
|
|
|
|
|
:Description:
|
|
|
|
|
The user is identified by their Matrix ID.
|
|
|
|
|
|
|
|
|
|
A client can identify a user using their Matrix ID. This can either be the
|
|
|
|
|
fully qualified Matrix user ID, or just the localpart of the user ID.
|
|
|
|
|
|
|
|
|
|
.. code:: json
|
|
|
|
|
|
|
|
|
|
"identifier": {
|
|
|
|
|
"type": "m.id.user",
|
|
|
|
|
"user": "<user_id or user localpart>"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Third-party ID
|
|
|
|
|
<<<<<<<<<<<<<<
|
|
|
|
|
:Type:
|
|
|
|
|
``m.id.thirdparty``
|
|
|
|
|
:Description:
|
|
|
|
|
The user is identified by a third-party identifer in canonicalised form.
|
|
|
|
|
|
|
|
|
|
A client can identify a user using a 3pid associated with the user's account on
|
|
|
|
|
the homeserver, where the 3pid was previously associated using the
|
|
|
|
|
|/account/3pid|_ API. See the `3PID Types`_ Appendix for a list of Third-party
|
|
|
|
|
ID media.
|
|
|
|
|
|
|
|
|
|
.. code:: json
|
|
|
|
|
|
|
|
|
|
"identifier": {
|
|
|
|
|
"type": "m.id.thirdparty",
|
|
|
|
|
"medium": "<The medium of the third party identifier>",
|
|
|
|
|
"address": "<The canonicalised third party address of the user>"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Phone number
|
|
|
|
|
<<<<<<<<<<<<
|
|
|
|
|
:Type:
|
|
|
|
|
``m.id.phone``
|
|
|
|
|
:Description:
|
|
|
|
|
The user is identified by a phone number.
|
|
|
|
|
|
|
|
|
|
A client can identify a user using a phone number associated with the user's
|
|
|
|
|
account, where the phone number was previously associated using the
|
|
|
|
|
|/account/3pid|_ API. The phone number can be passed in as entered by the
|
|
|
|
|
user; the homeserver will be responsible for canonicalising it. If the client
|
|
|
|
|
wishes to canonicalise the phone number, then it can use the
|
|
|
|
|
``m.id.thirdparty`` identifier type with a ``medium`` of ``msisdn`` instead.
|
|
|
|
|
|
|
|
|
|
.. code:: json
|
|
|
|
|
|
|
|
|
|
"identifier": {
|
|
|
|
|
"type": "m.id.phone",
|
|
|
|
|
"country": "<The country that the phone number is from>",
|
|
|
|
|
"phone": "<The phone number>"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Login
|
|
|
|
|
~~~~~
|
|
|
|
|
|
|
|
|
@ -729,7 +823,10 @@ request as follows:
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"type": "m.login.password",
|
|
|
|
|
"user": "<user_id or user localpart>",
|
|
|
|
|
"identifier": {
|
|
|
|
|
"type": "m.id.user",
|
|
|
|
|
"user": "<user_id or user localpart>"
|
|
|
|
|
},
|
|
|
|
|
"password": "<password>"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -741,8 +838,10 @@ explicitly, as follows:
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"type": "m.login.password",
|
|
|
|
|
"medium": "<The medium of the third party identifier. Must be 'email'>",
|
|
|
|
|
"address": "<The third party address of the user>",
|
|
|
|
|
"identifier": {
|
|
|
|
|
"medium": "<The medium of the third party identifier>",
|
|
|
|
|
"address": "<The canonicalised third party address of the user>"
|
|
|
|
|
},
|
|
|
|
|
"password": "<password>"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1477,3 +1576,4 @@ have to wait in milliseconds before they can try again.
|
|
|
|
|
.. _/user/<user_id>/account_data/<type>: #put-matrix-client-%CLIENT_MAJOR_VERSION%-user-userid-account-data-type
|
|
|
|
|
|
|
|
|
|
.. _`Unpadded Base64`: ../appendices.html#unpadded-base64
|
|
|
|
|
.. _`3PID Types`: ../appendices.html#pid-types
|
|
|
|
|