cells admin user token
./cells admin user token
Generate a personal token for a user
Generate a personal authentication token for a user.
Expiration can be set in two ways:
+ A hard limit, by using the -e flag (duration) + A sliding window by using the -a flag (duration): in that case the token expiration will be refreshed each time the token is used (e.g a request using this token is received).
Generate a token that lasts 24 hours for user admin $ ./cells user token -u admin -e 24h
Generate a token that lasts by default 10mn, but which expiration is refreshed to the next 10mn each time token is used. $ ./cells user token -u admin -a 10m
These token can be used in replacement of an OAuth2-based access token : they can replace the "Bearer" access token when calling any REST API. They can also be used as the password (in conjunction with username) for all basic-auth based APIs (e.g. webDAV).
By default, generated tokens grant the same level of access as a standard login operation. To improve security, it is possible to restrict these accesses to a specific file or folder (given it is accessible by the user in first place) with a "scope" in the format "node:NODE_UUID:PERMISSION" where PERMISSION string contains either "r" (read) or "w" (write) or both.
./cells admin user token [flags]
-a, --auto string Auto-refresh (number of seconds, see help) -e, --expire string Expire after duration, format is 20u where u is a unit: s (second), (minute), h (hour), d(day). -h, --help help for token -s, --scope strings Optional scopes -u, --user string User login (mandatory)
Options inherited from parent commands
--broker string Pub/sub service for events between services (currently nats only) (default "nats") --broker_address string Nats broker port (default ":4222") --registry_address string Registry connection address (default ":4222") --registry_cluster_address string Registry cluster address --registry_cluster_routes string Registry cluster routes --transport string Transport protocol for RPC (default "grpc") --transport_address string Transport protocol port (default ":4222")
- ./cells admin user - Manage users