====== C2S Packet 1: Authorization Attempt ====== Attempts authorization with the server. There are two supported formats. One works roughly the same as the [[https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Authorization|HTTP Authorization header]], the other is considered legacy and is implementation defined. ===== Format ===== ^ Index ^ Type ^ Description ^ | 0 | ''%%1%%'' | Authorization Attempt packet ID | | 1 | [[sockchat:types#string|string]] | Authentication scheme, e.g. Bearer. | | 2 | [[sockchat:types#string|string]] | Authorization arguments. | The only difference between the Authorization header is that the scheme and arguments are separated by a ''%%\t%%'' instead of a space. The legacy format would send index 1 and up to a private verification script. Only one public implementation of this was the one for phpBB, which substitutes index 1 for the current User ID and index 2 for the Session ID cookie value. SharpChat falls back to the legacy implementation by checking whether index 1 is numeric, in which case it is assumed to be a user id. ===== Examples ====== A client authenticating using a Bearer token: 1\tBearer\tUiTfepl9rNY0dGMpDjehMu1FR7DqsXPbtd2kis8sHKGaHXNdK2B6iG6JrpARyOqU A client authenticating using a Flashii Misuzu token: 1\tMisuzu\tAgOr1Q7cwN5hp7szVwoC-PapvsJWajdU3_sjNLdJqqx0D1b51AF1ATEBc0BndjJLd2pvU2hHdzN5SjNzUiTfepl9rNY0dGMpDjehMu1FR7DqsXPbtd2kis8sHKGaHXNdK2B6iG6JrpARyOqU A client authenticating using the legacy phpBB format: 1\t2\tEvFvkZgLFoG1ZShMxpxILmS744usEjmH ===== See Also ===== * [[sockchat:s2c:authz-success|S2C Packet 1.y: Authorization Success]] - Informs the client that authorization succeeded and who they are. * [[sockchat:s2c:authz-fail|S2C Packet 1.n: Authorization Failure]] - Informs the client that authorization failed and why.