Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Get current user details

GET /user

Returns details about currently authenticated user.

This operation can be invoked on behalf of the current user only.

Example cURL requests

Get user details

curl -u admin:password -X GET https://$HOST/api/v3/onezone/user

{
  "userId": "a5b469a2b0516b662a49da74d6d7d7bc",
  "fullName": "Mr Admin",
  "username": "admin",
  "linkedAccounts": [],
  "emails": [],
  "basicAuthEnabled": false
}

Request Examples

Shell
onezone-rest-cli getCurrentUser

Responses

application/json
200

Returns the information about user.

PropertyType & Description
userId
string

Unique user Id.

fullName
string

User's full name (given names + surname).

username
string

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.

linkedAccounts
array of objects (LinkedAccount)

The list of accounts linked to this user.

idp required
string

Id of the Identity Provider, as specified in Onezone's auth.config.

subjectId required
string

Unique user Id assigned by the Identity Provider.

fullName
string

User's full name (given names + surname).

username
string

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.

emails
array of strings

The list of user email accounts.

entitlements
array of strings

A list of strings denoting user group memberships as acquired from the identity provider. Memberships are in Onedata normalized form.

custom
object

Custom user data collected upon login, depending on Onezone auth.config.

emails
array of strings
basicAuthEnabled
boolean

Specifies if this user is allowed to authenticate with username & password.

Example

application/json
{
  "userId": "f1c8b1a37aa7447b22eb65a742d40524",
  "fullName": "Rudolf Lingens",
  "username": "r.lingens",
  "linkedAccounts": [
    {
      "idp": "github",
      "subjectId": "1978f5775ae2dc16730418bf3fc81764"
    },
    {
      "idp": "elixir",
      "subjectId": "38bf3fc2f4c16730481764bd775ae2d1"
    }
  ],
  "emails": [
    "rudolf.lingens@example.com",
    "john.doe@example.com"
  ],
  "basicAuthEnabled": false
}
400

Invalid request.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
403

Forbidden request.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
404

Resource not found..

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
500

Internal server error.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}