Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Map IdP user to Onezone user

POST /provider/public/map_idp_user

Maps external IdP user id into internal user id in Onezone.

The user does not have to exist in Onezone or the IdP - this method merely transforms the Id using a deterministic procedure. It can be used to predict the user Id in Onezone before it is created.

This operation has public access.

Example cURL requests

Map IdP user to Onezone user

curl -H 'Content-type: application/json' \
-d '{"idp": "elixir", "userId": "dqs1ew2afn9q28rnweu8fb23r9jqwtfg"}' \
-X POST https://onezone.example.com/api/v3/onezone/provider/public/map_idp_user

{
  "userId": "0fe7c8a20ffdf07480c46f084bc3b8d5"
}

Request body

application/json

Mapping parameters

PropertyType & Description
ipd
string

External IdP (identity provider).

userId
string

UserId in given IdP.

Request Examples

Shell
onezone-rest-cli mapIdpUser ipd==elixir userId==elixir:members

Responses

application/json
200

The user Id in external IdP.

PropertyType & Description
userId
string

Internal user Id in Onezone.

Example

application/json
{
  "userId": "0fe7c8a20ffdf07480c46f084bc3b8d5"
}
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."
  }
}
401

Authentication 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."
  }
}
403

Authorization 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."
  }
}
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."
  }
}