Find Access Tokens

Search for Access Tokens matching a given name or owner, or page through all of your Access Tokens. Note that the returned Access Tokens will include other metadata but will not include the secret, and therefore cannot be used to authenticate SDK requests. The secret is only available when you first create new Access Tokens because Catalytic does not store the Access Token's secret. As a security measure, only a hash of the secret is stored.

👍

Permissions Required

You can only get metadata for Access Tokens that you created, unless you are a team administrator. Team admins can get metadata for all Access Tokens on your Catalytic team.

Method Signature

find(Filter $filter = null, string $pageToken = null, int $pageSize = null): AccessTokensPage

Parameters

ParameterTypeDescription
$filterFilterThe filter criteria to search by, or null to fetch all Access Tokens.
$pageTokenstringThe token of the page to fetch.
$pageSizeintThe number of results per page to fetch.
returnsAccessTokensPageThe requested page of Access Tokens

You can search for matches among the following attributes of the Where class.

NameTypeDescription
textstringSearch for Access Tokens by name.
ownerstringSearch for Access Tokens owned by a specific team member. The email address of the owner of the Instance must match exactly, apart from casing.

Example

<?php

/*
 * This example demonstrates an administrator finding and revoking
 * all the Access Tokens of another user.
 */

require_once(__DIR__ . '/vendor/autoload.php');

use Catalytic\SDK\CatalyticClient;
use Catalytic\SDK\Search\Where;

$catalytic = new CatalyticClient();

$where = (new Where())->owner()->matches('[email protected]');
$results = $catalytic->accessTokens()->find($where);
$accessTokens = $results->getAccessTokens();

// Loop through all the pages of results
while (!empty($results->getNextPageToken())) {
    $results = $catalytic->accessTokens()->find($where, $results->getNextPageToken());
    $accessTokens = array_merge($credentials, $results->getCredentials());
}