syntax = "proto2"; package auth; import "common.proto"; // Server entrypoint, authenticates users and grants initial session token. service Auth { // Send credentials, returns valid session token. rpc Login (LoginRequest) returns (LoginResponse); // If the given token has recently expired, get a new valid one. rpc Refresh (common.Token) returns (common.Token); } // The login request message. message LoginRequest { // The username to log in with. required string username = 1; // The password to log in with. required string password = 2; } // The login response message. message LoginResponse { // The newly created session token. required common.Token token = 1; // The user profile that has been authenticated. required common.User user = 2; }