grpcurl prints field names in JSON’s camelCase; the proto names are session_token, expires_at and
idle_timeout_seconds. Treat the token as opaque, and as a secret: it is as good as your password
until it expires.
What Login checks
Exactly what REST Basic authentication checks:- the login exists, and is an HTTP login with a password;
- the password matches;
- the address you call from is on the login’s allowed addresses, when it has any.
How long a token lasts
Your provider can change all three;
idle_timeout_seconds in the Login answer is the idle limit in
force.
A token is bound to the address it was issued to: presented from another address it is refused.
It is not bound to the connection, so a second channel from the same address can use the same token.
Logging in again: SESSION_EXPIRED
Sessions are held in the gateway’s memory. A token can therefore stop working at any moment for
reasons that are not your fault:
- the gateway restarted;
- a load balancer moved your channel to another gateway node;
- the token reached one of the limits above;
- your login was changed or disabled.
SESSION_EXPIRED never counts against your address. Repeated refused logins from one address get
that address blocked by your provider — on every port, as for REST and SMPP — but an expired session
is not a refused login. A fleet of clients reconnecting after a gateway restart is not blocked for
it. Every other refusal on this page does count, exactly as a failed REST login does.Logging out
Logout ends the session at once. It is optional — an unused token expires on its own — but it is
the polite thing for a short-lived process to do, and it frees one of the login’s 64 slots.
Refusals
The four Login refusals in the first row are one answer on purpose. Trying names tells a caller
nothing about which logins exist.
Behind your own proxy or NAT
The token is bound to the address the gateway sees. If your outbound traffic leaves through several addresses — a pool of NAT gateways, for example — a token issued on one and used from another is answeredSESSION_EXPIRED. Either pin a channel to one egress address, or let the re-login wrapper
handle it, knowing each address change costs a Login.
Related
Errors and status codes
Every refusal, and what to do about it.
REST authentication
The same login, over HTTP Basic.