2024-10-23 16:47:02 -04:00
# Introduction
`USR` is a command introduced with [MSNP2 ](../versions/msnp2.md ).
The command exists in all services, without a request or response payload.
Specifies a user that wants to authenticate to the service.
For the command that is used when sending this to a Dispatch Server, read [XFR ](xfr.md ).
2024-10-26 06:56:17 -04:00
This command can only be sent once.
Any further uses of this command in the same session is Undefined Behaviour.
2024-10-23 16:47:02 -04:00
# Client/Request
## Dispatch Server or Notification Server
### The Initial request
`USR TrID security-package I user-handle`
Depending on the version of the protocol you are using, `security-package` can be:
* `CTP` : Clear Text Password. Only in [MSNP2 ](../versions/msnp2.md ).
* `MD5` : MD5-based authentication. Only in [MSNP2 ](../versions/msnp2.md ) to [MSNP7 ](../versions/msnp7.md ).
2024-11-26 16:15:34 -05:00
* `TWN` : "Tweener", [Passport 1.4 ](../services/passport14.md ) or compatible authentication service. Since [MSNP8 ](../versions/msnp8.md ).
* `SSO` : Single Sign On, usually a more advanced [Passport (SOAP) ](../services/passportsoap.md ) authentication method. Since [MSNP15 ](../versions/msnp15.md ).
2024-10-23 16:47:02 -04:00
### The Subsequent request
`USR TrID security-package S {...response-args}`
Where `response-args` can be anything, but based on `security-package` it can be:
* `CTP` : Your password in plain text.
* `MD5` : The server's login challenge concatenated with your password.
2024-11-26 16:15:34 -05:00
* `TWN` : The `from-PP` parameter in the `Authentication-Info` header sent in response to [Passport 1.4 ](../services/passport14.md ),
or if using [Passport (SOAP) ](../services/passportsoap.md ), the `<wsse:BinarySecurityToken>` of the relevant `<wst:RequestSecurityTokenResponse>` .
* `SSO` : The same as [Passport (SOAP) ](../services/passportsoap.md ) in `TWN` , but with the extra parameter
2024-10-23 16:47:02 -04:00
being the custom challenge response encoded as base64.
## Switchboard Server
`USR TrID user-handle cookie`
Where `user-handle` is your current user handle.
Where `cookie` is the relevant parameter given from [XFR ](xfr.md ) or [RNG ](rng.md ).
# Server/Response
## Dispatch Server or Notification Server
### Requesting a Subsequent action
`USR TrID OK security-package S {...challenge}`
Where `challenge` , based on the `security-package` is:
* `CTP` : Nothing. This parameter is omitted.
* `MD5` : The login challenge to concatenate with your password.
* `TWN` : The Passport login parameters.
* `SSO` : The Passport login policy and a base64-encoded key.
### Successfully authenticated
2024-10-24 10:17:51 -04:00
`USR TrID OK user-handle {friendly-name} {verified} {account-restricted}`
2024-10-23 16:47:02 -04:00
Where `OK` is always `OK` .
Where `user-handle` is your user handle.
Where `friendly-name` is your current Friendly Name. Removed in [MSNP10 ](../versions/msnp10.md ).
Where `verified` is the account's verification status,
where 0 is unverified, and 1 is verified. Added since [MSNP6 ](../versions/msnp6.md ).
2024-10-24 10:17:51 -04:00
Where `account-restricted` is the account's restricted status,
where 0 is unrestricted, and 1 is restricted. Added since [MSNP8 ](../versions/msnp8.md ).
If this is set, the Client may log out automatically and ask to use MSN Explorer.
2024-10-23 16:47:02 -04:00
## Switchboard Server
`USR TrID OK user-handle friendly-name`
Where `user-handle` is your current user handle.
Where `friendly-name` is your current friendly name.
# Examples
## Notification Server
### Using CTP
*Only in [MSNP2 ](../versions/msnp2.md ).*
```
C: USR 1 CTP I example@hotmail.com
S: USR 1 CTP S
C: USR 2 CTP S password
S: USR 2 OK example@hotmail.com example%20user
```
### Using MD5
*Only in [MSNP2 ](../versions/msnp2.md ) to [MSNP7 ](../versions/msnp7.md ).*
```
C: USR 3 MD5 I example@hotmail.com
S: USR 3 MD5 S 1234567890.123456789
C: USR 4 MD5 S f59af8f2fa91d38aff7c870c17f99903
2024-10-24 10:17:51 -04:00
S: USR 4 OK example@hotmail.com example%20user 1
2024-10-23 16:47:02 -04:00
```
### Using TWN
*Since [MSNP8 ](../versions/msnp8.md ).*
```
C: USR 5 TWN I example@hotmail.com
2024-10-24 10:17:51 -04:00
S: USR 5 TWN S passport=parameters,neat=huh,lc=1033,id=507
2024-10-23 16:47:02 -04:00
```
*The HTTPS interlude has been moved to the [Passport 1.4 ](../services/passport14.md ) article.*
```
2024-10-24 10:17:51 -04:00
C: USR 6 TWN S t=token& p=profile
S: USR 6 OK example@hotmail.com example%20user 1 0
2024-10-23 16:47:02 -04:00
```
### Using SSO
*Since [MSNP15 ](../versions/msnp15.md ).*
*NOTE: This has been line-breaked.
Lines beginning with `..` followed by a space are continuations of the previous line.*
```
C: USR 7 SSO I example@hotmail.com
S: USR 7 SSO S MBI_KEY_OLD AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
```
2024-11-26 16:15:34 -05:00
*The HTTPS interlude has been moved to the [Passport (SOAP) ](../services/passportsoap.md ) article.*
*The key-encryption interlude has been removed from here and is to reinstated as another article.*
2024-10-23 16:47:02 -04:00
```
2024-11-26 16:15:34 -05:00
C: USR 8 SSO S t=ticket HAAAAAEAAAADZgAABIAAAAgAAAAUAAAASAAAAAA
.. AAAAAAAAA7XgT5ohvaZdoXdrWUUcMF2G8OK2JohyYcK5l5MJSitab33scxJe
.. K/RQXcUr0L+R2ZA9CEAzn0izmUzSMp2LZdxSbHtnuxCmptgtoScHp9E26HjQ
.. VkA9YJxgK/HM=
2024-10-23 16:47:02 -04:00
S: USR 8 OK example@hotmail.com
```
### Invalid username or password
```
C: USR 9 TWN I example@hotmail.com
S: USR 9 TWN S passport=parameters,neat=huh,lc=1033,id=507
C: USR 10 TWN S t=not*a*passport*ticket& p=not*a*profile*either
S: 911 10
```
Server disconnects client.
2024-10-24 10:17:51 -04:00
### Child account not authorized
*Since [MSNP4 ](../versions/msnp4.md ).*
2024-10-23 16:47:02 -04:00
```
C: USR 11 MD5 I example@hotmail.com
S: USR 11 MD5 S 1234567890.123456789
C: USR 12 MD5 S f59af8f2fa91d38aff7c870c17f99903
2024-10-24 10:17:51 -04:00
S: 923 12
2024-10-23 16:47:02 -04:00
```
2024-10-24 10:17:51 -04:00
Server disconnects client.
### Account not verified
#### Hard block
*Since [MSNP5 ](../versions/msnp5.md ).*
*NOTE: This will show the Account Verification dialog.*
```
C: USR 13 MD5 I example@hotmail.com
S: USR 13 MD5 S 1234567890.123456789
C: USR 14 MD5 S f59af8f2fa91d38aff7c870c17f99903
S: 924 14
```
Server disconnects client.
#### Soft warning
*Since [MSNP6 ](../versions/msnp6.md ).*
```
C: USR 15 MD5 I example@hotmail.com
S: USR 15 MD5 S 1234567890.123456789
C: USR 16 MD5 S f59af8f2fa91d38aff7c870c17f99903
S: USR 16 OK example@hotmail.com example%20user 0
```
### Account restricted
*Since [MSNP8 ](../versions/msnp8.md ).*
*NOTE: This will automatically log you out and force you to use MSN Explorer instead.*
```
C: USR 17 TWN I example@hotmail.com
S: USR 17 TWN S passport=parameters,neat=huh,lc=1033,id=507
C: USR 18 TWN S t=token& p=profile
S: USR 18 OK example@hotmail.com example%20user 1 1
```
Client disconnects from server.
2024-10-23 16:47:02 -04:00
### Wrong server for this account
```
2024-10-24 10:17:51 -04:00
C: USR 19 TWN I example@hotmail.com
S: 931 19
2024-10-23 16:47:02 -04:00
```
2024-10-24 10:17:51 -04:00
Server disconnects client.
2024-10-23 16:47:02 -04:00
## Switchboard Server
```
2024-10-24 10:17:51 -04:00
C: USR 20 example@passport.com 1234567890.1234567890.1234567890
S: USR 20 OK example@passport.com example%20user
2024-10-23 16:47:02 -04:00
```
# Known changes
* [MSNP3 ](../versions/msnp3.md ): Removed the `CTP` security package.
* [MSNP6 ](../versions/msnp6.md ): Added account verification bit to [USR OK ](#successfully-authenticated ).
2024-11-26 16:15:34 -05:00
* [MSNP8 ](../versions/msnp8.md ): Added account restriction bit to [USR OK ](#successfully-authenticated ) and
2024-10-23 16:47:02 -04:00
removed the `MD5` security package, and replaced with the `TWN` security package.
* [MSNP15 ](../versions/msnp15.md ): Added support for the `SSO` security package.