Create new user
Creates a new user.
The fullName and username may be provided directly or derived from linked accounts.
Full name resolution:
- The value of the
fullNameparameter, if provided - The first valid
fullNamefrom the linked accounts (after normalization) Unnamed User, if none of the above
NOTE: the value
Unnamed Useris treated as a missing value (i.e. equivalent to unspecifiedfullName).
Username resolution:
- The value of the
usernameparameter, if provided - The first valid
usernamefrom the linked accounts (after normalization) null(no username), if none of the above
This operation requires oz_users_create admin privilege.
Example cURL requests
Create a new user
curl -u username:password -H "Content-type: application/json" \
-X POST -d '{ "username" : "new_user", "password": "lS1c6FD2mxB2ff" }' \
https://$ZONE_HOST/api/v3/onezone/users
Create a new user with a preconfigured linked account
curl -u username:password -H "Content-type: application/json" \
-X POST -d '{
"linkedAccounts": [{
"idp" : "egi",
"username" : "janedoe",
"subjectId" : "96ac30df1113de761bb42967da314dffe725d7b9@egi.eu",
"groups" : [
"urn:mace:egi.eu:group:test-group.egi.eu:role=vm_operator#aai.egi.eu",
"urn:mace:egi.eu:group:test-group.egi.eu:role=member#aai.egi.eu"
],
"fullName" : "Jane Done",
"entitlements" : [
"urn:mace:egi.eu:group:test-group.egi.eu:role=vm_operator#aai.egi.eu",
"urn:mace:egi.eu:group:test-group.egi.eu:role=member#aai.egi.eu"
],
"emails" : [
"janedoe@example.com"
],
"custom" : {
"role": "developer"
}
}]
}' \
https://$ZONE_HOST/api/v3/onezone/users
Request body
User name.
User's full name (given names + surname). Defaults to Unnamed User.
User's human-readable identifier, unique across the system. Makes it easier to identify the user and can be used for signing in with password. Defaults to null (no username).
User's password (in plaintext). Typically used for admin accounts and users that cannot log in using an Identity Provider.
linkedAccounts array of objects (LinkedAccount) The list of preconfigured linked accounts. May be useful to create a user account before they log in. Requires knowledge of at least the user's subject ID in the IdP.
The list of preconfigured linked accounts. May be useful to create a user account before they log in. Requires knowledge of at least the user's subject ID in the IdP.
Id of the Identity Provider, as specified in Onezone's auth.config.
Unique user Id assigned by the Identity Provider.
User's full name (given names + surname).
User's human-readable identifier, unique across the system. Makes it easier to identify the user and can be used for signing in with password.
The list of user email accounts.
A list of strings denoting user group memberships as acquired from the identity provider. Memberships are in Onedata normalized form.
Custom user data collected upon login, depending on Onezone auth.config.
Request Examples
{
"fullName": "Rudolf Lingens",
"username": "r.lingens",
"password": "lS1c6FD2mxB2ff"
}Responses
URI of the created user in the form https://$ZONE_HOST/api/onezone/v3/users/{id} is returned in the response Location header.
Invalid request.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authentication error.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authorization error.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Resource not found.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Internal server Error.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}