Authorization

View as Markdown

Authorization

The authorization class defines the auth related queries of an app.

Example:

import * as contentstack from '@contentstack/marketplace-sdk'

const client = contentstack.client({ authtoken: 'TOKEN'});

client.marketplace('organization_uid').app('manifest_uid').authorization();

findAll

The findAll method retrieves the requests of all authorized apps in a particular organization.

NameTypeDescription
skipNumber

Offset for skipping content in response

limitNumber

Limit on API response to provide content in the list

orderMust be one of ['asc', 'desc', 'ASC', 'DESC']

Specify the order in which the apps should appear in the response, either ascending or descending.

sortMust be one of ['name', 'updated_at', 'created_at']

The order in which apps are sorted.

searchString

String for search by app name

Example:

import * as contentstack from '@contentstack/marketplace-sdk'

const client = contentstack.client({ authtoken: 'TOKEN'});


client.marketplace('organization_uid').app('manifest_uid').authorization().findAll({ skip: 10, limit: 10, order: 'asc' })

.then((response) => console.log(response));

revokeAll

Revoke all users tokens issued to an authorized app for the particular organization.

Example:

import * as contentstack from '@contentstack/marketplace-sdk'

const client = contentstack.client({ authtoken: 'TOKEN'});


client.marketplace('organization_uid').app('manifest_uid').authorization().revokeAll()

.then((response) => console.log(response));

revoke

Revoke user token issued to an authorized app for the particular organization.

Example:

import * as contentstack from '@contentstack/marketplace-sdk'

const client = contentstack.client({ authtoken: 'TOKEN'});


client.marketplace('organization_uid').app('manifest_uid').authorization().revoke('authorization_uid')

.then((response) => console.log(response));