Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Acquire IdP access token

POST /user/idp_access_token/{idp}

Acquires an access token issued by given IdP for the current user. This operation requires that the IdP is configured to support offline access - issues refresh tokens upon user's login to Onezone, which are later used to acquire new access tokens when they expire. Offline access can be configured by the Onezone admin.

The user must first log in to Onezone using given IdP, otherwise the operation will return a 404 error.

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

Example cURL requests

Acquire IdP access token

curl -u username:password -X POST \
https://$HOST/api/v3/onezone/user/idp_access_token/github

Path parameters

Parameter Type & Description
idp required
string

IdP identifier.

Request Examples

Shell
onezone-rest-cli acquireIdpAccessToken idp=github

Responses

application/json
200

The access token issued by given IdP.

PropertyType & Description
token
string

The access token.

ttl
integer

Time to live of the token (in seconds).

Example

application/json
{
  "token": "5fc7f98122413e93fc9acbc2cd804961a24501b5820ca6cd3e35b844da9e73b1",
  "ttl": 3597
}
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."
  }
}