Hi Lars,
This is a good question.
Vault is usually configured by an administrator and used by users/applications.
In this backend, there is a third entity as well, which the admin trusts.
1) vault write auth/app-id/map/app-id/app1 value=policy1
This is configured by an admin.
2) vault write auth/app-id/map/user-id/user1 value=app1
This is run by either an Admin/TrustedService who is "informed" of the unique "userId" (out-of-band, refer the docs) belonging to an application. The TrustedService is registering the user-id against the desired app.
For the above two commands to be run, the administrators and the trusted service will have a Vault token beforehand.
3) vault write auth/app-id/login app_id=app1 user_id=user1
For this, the curl substitute goes like this:
Notice that this path does not require a Vault token.
Sorry for confusing you with this earlier curl command with the Vault token (copy paste error).
This is an unauthenticated path, which the applications use to retrieve a Vault token.
Once the applications get a token, they can access Vault's resources that the token is authorized for.
If any such authorizations allows the token to request credentials from logical backends, applications can invoke appropriate commands of the logical backend, to get it.