Agent from connect() gives the same handle with agent.for_end_user(…)
(forEndUser(…)), without another round trip: the tool set an admin bound is the
application’s, identical for everyone it acts for. What changes is one header,
X-NeuralTrust-End-User.
No startup check, a link instead
connect() refuses to start when a server has no account, because a batch has
nobody to send a link to. A person does, so for_end_user() does not check at
startup. When a call needs an account the user has not connected, the gateway
refuses it with ConsentRequiredError, and the link to connect arrives inside
the error, because that is where the gateway mints it.
When you would rather ask than fail, check ahead of time:
Whose name it is
The name is yours to choose, and the gateway does not verify it: it trusts the application that holds the key. It namespaces the name by application, so two applications naminguser_123 never reach the same account. For the same
reason only an application’s own credential may assert one: a request carrying
a person’s own token is already that person.
This is the code side of acting for end users on the
gateway.