OAuth API schema

service.oauth.graphqls

To authenticate API requests, you’ll need an API token. Learn how to generate an access token.

See usage examples in the cloudbeaver-graphql-examples repository.

You can try queries in the built-in GraphQL console, available on your server at https://your-server-address/api/gql/console. This tool lets you test requests directly from your browser.

For a live example, see the demo GraphQL console.

API Endpoints
https://your-server-address/api/gql

Queries

oauthAuthorizationInfo

Description

Returns OAuth client and scope details for consent screen

Response

Returns an OAuthAuthorizationInfo!

Arguments
Name Description
code - String!

Example

Query
query oauthAuthorizationInfo($code: String!) {
  oauthAuthorizationInfo(code: $code) {
    clientName
    scopes
  }
}
Variables
{"code": "<string>"}
Response
{
  "data": {
    "oauthAuthorizationInfo": {"clientName": "<string>", "scopes": ["<string>"]}
  }
}

oauthClient

Description

Returns a registered OAuth client by id

Response

Returns an OAuthClientInfo

Arguments
Name Description
clientId - String!

Example

Query
query oauthClient($clientId: String!) {
  oauthClient(clientId: $clientId) {
    clientId
    clientSecret
    clientName
    redirectUris
    scope
  }
}
Variables
{"clientId": "<string>"}
Response
{
  "data": {
    "oauthClient": {
      "clientId": "<string>",
      "clientSecret": "<string>",
      "clientName": "<string>",
      "redirectUris": ["<string>"],
      "scope": "<string>"
    }
  }
}

oauthClients

Description

Returns all registered OAuth clients

Response

Returns [OAuthClientInfo!]!

Example

Query
query oauthClients {
  oauthClients {
    clientId
    clientSecret
    clientName
    redirectUris
    scope
  }
}
Response
{
  "data": {
    "oauthClients": [
      {
        "clientId": "<string>",
        "clientSecret": "<string>",
        "clientName": "<string>",
        "redirectUris": ["<string>"],
        "scope": "<string>"
      }
    ]
  }
}

Mutations

oauthAuthorizationDecision

Description

Makes OAuth consent decision and returns redirect URL for the client callback

Response

Returns an OAuthAuthorizationDecisionResult!

Arguments
Name Description
code - String!
decision - OAuthConsentDecision!

Example

Query
mutation oauthAuthorizationDecision(
  $code: String!,
  $decision: OAuthConsentDecision!
) {
  oauthAuthorizationDecision(
    code: $code,
    decision: $decision
  ) {
    redirectUrl
  }
}
Variables
{"code": "<string>", "decision": "ALLOW"}
Response
{"data": {"oauthAuthorizationDecision": {"redirectUrl": "<string>"}}}

oauthDeleteClient

Description

Deletes a registered OAuth client

Response

Returns a Boolean!

Arguments
Name Description
clientId - String!

Example

Query
mutation oauthDeleteClient($clientId: String!) {
  oauthDeleteClient(clientId: $clientId)
}
Variables
{"clientId": "<string>"}
Response
{"data": {"oauthDeleteClient": "<boolean>"}}

oauthRegisterClient

Description

Registers an OAuth client from the management UI

Response

Returns an OAuthClientInfo!

Arguments
Name Description
clientName - String!
redirectUris - [String!]!
scope - String

Example

Query
mutation oauthRegisterClient(
  $clientName: String!,
  $redirectUris: [String!]!,
  $scope: String
) {
  oauthRegisterClient(
    clientName: $clientName,
    redirectUris: $redirectUris,
    scope: $scope
  ) {
    clientId
    clientSecret
    clientName
    redirectUris
    scope
  }
}
Variables
{"clientName": "<string>", "redirectUris": "<string>", "scope": "<string>"}
Response
{
  "data": {
    "oauthRegisterClient": {
      "clientId": "<string>",
      "clientSecret": "<string>",
      "clientName": "<string>",
      "redirectUris": ["<string>"],
      "scope": "<string>"
    }
  }
}

oauthRotateClientSecret

Description

Generates a new secret for a registered OAuth client

Response

Returns a String!

Arguments
Name Description
clientId - String!

Example

Query
mutation oauthRotateClientSecret($clientId: String!) {
  oauthRotateClientSecret(clientId: $clientId)
}
Variables
{"clientId": "<string>"}
Response
{
  "data": {
    "oauthRotateClientSecret": "<string>"
  }
}

Types

Boolean

Description

The Boolean scalar type represents true or false.

Example
"<boolean>"

OAuthAuthorizationDecisionResult

Fields
Field Name Description
redirectUrl - String!
Example
{"redirectUrl": "<string>"}

OAuthAuthorizationInfo

Fields
Field Name Description
clientName - String!
scopes - [String!]!
Example
{"clientName": "<string>", "scopes": ["<string>"]}

OAuthClientInfo

Fields
Field Name Description
clientId - String!
clientSecret - String!
clientName - String!
redirectUris - [String!]!
scope - String
Example
{
  "clientId": "<string>",
  "clientSecret": "<string>",
  "clientName": "<string>",
  "redirectUris": ["<string>"],
  "scope": "<string>"
}

OAuthConsentDecision

Values
Enum Value Description

ALLOW

DENY

Example
"ALLOW"

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"<string>"