2
0

login5.proto 898 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // A minimal set of protobuf messages required to auth through login5, with a stored credential.
  2. message StoredCredential {
  3. required string username = 1;
  4. required bytes data = 2;
  5. }
  6. message ClientInfo {
  7. required string client_id = 1;
  8. required string device_id = 2;
  9. }
  10. message LoginRequest {
  11. required ClientInfo client_info = 1;
  12. oneof login_method {
  13. StoredCredential stored_credential = 100;
  14. }
  15. }
  16. message LoginOk {
  17. required string access_token = 2;
  18. optional int32 access_token_expires_in = 4;
  19. }
  20. message LoginResponse {
  21. oneof response {
  22. LoginOk ok = 1;
  23. LoginError error = 2;
  24. }
  25. }
  26. enum LoginError {
  27. UNKNOWN_ERROR = 0;
  28. INVALID_CREDENTIALS = 1;
  29. BAD_REQUEST = 2;
  30. UNSUPPORTED_LOGIN_PROTOCOL = 3;
  31. TIMEOUT = 4;
  32. UNKNOWN_IDENTIFIER = 5;
  33. TOO_MANY_ATTEMPTS = 6;
  34. INVALID_PHONENUMBER = 7;
  35. TRY_AGAIN_LATER = 8;
  36. }