Documentation

AuthleteApi

Authlete API.

Tags
link
https://docs.authlete.com/

Table of Contents

authorization()  : AuthorizationResponse
Call Authlete's /api/auth/authorization API.
authorizationFail()  : AuthorizationFailResponse
Call Authlete's /api/auth/authorization/fail API.
authorizationIssue()  : AuthorizationIssueResponse
Call Authlete's /api/auth/authorization/issue API.
backchannelAuthentication()  : BackchannelAuthenticationResponse
Call Authlete's /api/backchannel/authentication API.
backchannelAuthenticationComplete()  : BackchannelAuthenticationCompleteResponse
Call Authlete's /api/backchannel/authentication/complete API.
backchannelAuthenticationFail()  : BackchannelAuthenticationFailResponse
Call Authlete's /api/backchannel/authentication/fail API.
backchannelAuthenticationIssue()  : BackchannelAuthenticationIssueResponse
Call Authlete's /api/backchannel/authentication/issue API.
createClient()  : Client
Create a client (= call Authlete's /api/client/create API).
createService()  : Service
Create a service (= call Authlete's /api/service/create API).
deleteClient()  : mixed
Delete a client (= call Authlete's /api/client/delete/{clientId} API).
deleteClientAuthorization()  : mixed
Delete all existing access tokens issued to the client application by the end-user (= call Authlete's /api/client/authorization/delete/{clientId} API).
deleteGrantedScopes()  : mixed
Delete DB records about the set of scopes that an end-user has granted to a client application (= call Authlete's /api/client/granted_scopes/delete/{clientId} API).
deleteService()  : mixed
Delete a service (= call Authlete's /api/service/delete/{apiKey} API).
deviceAuthorization()  : DeviceAuthorizationResponse
Call Authlete's /api/device/authorization API.
deviceComplete()  : DeviceCompleteResponse
Call Authlete's /api/device/complete API.
deviceVerification()  : DeviceVerificationResponse
Call Authlete's /api/device/verification API.
getClient()  : Client
Get information about a client (= call Authlete's /api/client/get/{clientId} API).
getClientAuthorizationList()  : AuthorizedClientListResponse
Get the list of client applications authorized by the end-user (= call Authlete's /api/client/authorization/get/list API).
getClientList()  : mixed
Get a list of clients (= call Authlete's /api/client/get/list API).
getGrantedScopes()  : GrantedScopesGetResponse
Get the set of scopes that an end-user has granted to a client application (= call Authlete's /api/client/granted_scopes/get/{clientId} API).
getService()  : Service
Get information about a service (= call Authlete's /api/service/get/{apiKey} API).
getServiceConfiguration()  : string
Get the configuration of the service in JSON format that complies with OpenID Connect Discovery 1.0 (= call Authlete's /api/service/configuration API).
getServiceJwks()  : string
Get the JWK Set of a service (= call Authlete's /api/service/jwks/get API).
getServiceList()  : ServiceListResponse
Get a list of services that belong to the service owner (= call Authlete's /api/service/get/list API).
getSettings()  : Settings
The settings of this AuthleteApi implementation.
introspection()  : IntrospectionResponse
Call Authlete's /api/auth/introspection API.
pushAuthorizationRequest()  : PushedAuthReqResponse
Call Authlete's /api/pushed_auth_req API.
refreshClientSecret()  : ClientSecretRefreshResponse
Refresh the client secret of a client (= call Authlete's /api/client/secret/refresh/{clientId} API).
revocation()  : RevocationResponse
Call Authlete's /api/auth/revocation API.
standardIntrospection()  : StandardIntrospectionResponse
Call Authlete's /api/auth/introspection/standard API.
token()  : TokenResponse
Call Authlete's /api/auth/token API.
tokenCreate()  : TokenCreateResponse
Call Authlete's /api/auth/token/create API.
tokenDelete()  : mixed
Delete an access token (= call Authlete's /api/auth/token/delete/{token} API).
tokenFail()  : TokenFailResponse
Call Authlete's /api/auth/token/fail API.
tokenIssue()  : TokenIssueResponse
Call Authlete's /api/auth/token/issue API.
tokenUpdate()  : TokenUpdateResponse
Call Authlete's /api/auth/token/update API.
updateClient()  : Client
Update a client (= call Authlete's /api/client/update/{clientId} API).
updateClientAuthorization()  : ApiResponse
Update attributes of all existing access tokens issued to the client application by the end-user (= call Authlete's /api/client/authorization/update/{clientId} API).
updateClientSecret()  : ClientSecretUpdateResponse
Update the client secret of a client (= call Authlete's /api/client/secret/update/{clientId} API).
updateService()  : Service
Update a service (= call Authlete's /api/service/update/{apiKey} API).
userInfo()  : UserInfoResponse
Call Authlete's /api/auth/userinfo API.
userInfoIssue()  : UserInfoIssueResponse
Call Authlete's /api/auth/userinfo/issue API.

Methods

createClient()

Create a client (= call Authlete's /api/client/create API).

public createClient(Client $client) : Client
Parameters
$client : Client

Information about the client you want to create.

Tags
throws
AuthleteApiException
Return values
Client

Information about the client that was newly created.

createService()

Create a service (= call Authlete's /api/service/create API).

public createService(Service $service) : Service
Parameters
$service : Service

Information about the service you want to create.

Tags
throws
AuthleteApiException
Return values
Service

Information about the service that was newly created.

deleteClient()

Delete a client (= call Authlete's /api/client/delete/{clientId} API).

public deleteClient(int|string $clientId) : mixed
Parameters
$clientId : int|string

The client ID of the client application you want to delete.

Tags
throws
AuthleteApiException
Return values
mixed

deleteClientAuthorization()

Delete all existing access tokens issued to the client application by the end-user (= call Authlete's /api/client/authorization/delete/{clientId} API).

public deleteClientAuthorization(string|int $clientId, string $subject) : mixed
Parameters
$clientId : string|int

Client ID.

$subject : string

Subject (= unique identifier) of an end-user.

Tags
throws
AuthleteApiException
Return values
mixed

deleteGrantedScopes()

Delete DB records about the set of scopes that an end-user has granted to a client application (= call Authlete's /api/client/granted_scopes/delete/{clientId} API).

public deleteGrantedScopes(int|string $clientId, string $subject) : mixed

Even if you delete records about granted scopes by calling this API, existing access tokens are not deleted and scopes of existing access tokens are not changed.

Please call this method if the end-user identified by the subject is deleted from your system. Otherwise, garbage data continue to exist in the database.

Parameters
$clientId : int|string

Client ID.

$subject : string

Subject (= unique identifier) of an end-user.

Tags
throws
AuthleteApiException
Return values
mixed

deleteService()

Delete a service (= call Authlete's /api/service/delete/{apiKey} API).

public deleteService(int|string $apiKey) : mixed
Parameters
$apiKey : int|string

The API key of the service.

Tags
throws
AuthleteApiException
Return values
mixed

getClient()

Get information about a client (= call Authlete's /api/client/get/{clientId} API).

public getClient(int|string $clientId) : Client
Parameters
$clientId : int|string

The client ID.

Tags
throws
AuthleteApiException
Return values
Client

Information about the client.

getClientAuthorizationList()

Get the list of client applications authorized by the end-user (= call Authlete's /api/client/authorization/get/list API).

public getClientAuthorizationList(ClientAuthorizationGetListRequest $request) : AuthorizedClientListResponse
Parameters
$request : ClientAuthorizationGetListRequest

Conditions of the query to Authlete's /api/client/authorization/get/list API.

Tags
throws
AuthleteApiException
Return values
AuthorizedClientListResponse

The list of client applications.

getClientList()

Get a list of clients (= call Authlete's /api/client/get/list API).

public getClientList([string $developer = null ], int $start[, int $end = 5 ]) : mixed

When $developer is null, a list of clients that belong to the service is returned. Otherwise, when $developer is not null, a list of clients that belong to the developer is returned.

The pair of $start and $end parameters denotes the range of the result set of the query. For example, if $start is 5 and $end is 7, the pair makes a range from 5 (inclusive) to 7 (exclusive) and the response will contain (at most) 2 pieces of client information, i.e., information about the 6th and 7th clients (the index starts from 0).

If ($end - $start) is equal to or less than 0, getClients() method of the response (\Authlete\Dto\ClientListResponse) returns null. But even in such a case, getTotalCount() method returns the total count. In other words, if you want to get just the total count, you can write the code as shown below.

// Call /api/client/get/list API.
$response = $api->getClientList($developer, 0, 0);

// Get the number of client applications.
$totalCount = $response->getTotalCount();
Parameters
$developer : string = null

The developer of the targeted clients, or null to get a list of clients of the entire service. This argument is optional and its default value is null.

$start : int

The start index (inclusive) of the result set of the query. Must not be negative. This argument is optional and its default value is 0.

$end : int = 5

The end index (exclusive) of the result set of the query. Must not be negative. This argument is optional and its default value is 5.

Tags
throws
AuthleteApiException
Return values
mixed

getGrantedScopes()

Get the set of scopes that an end-user has granted to a client application (= call Authlete's /api/client/granted_scopes/get/{clientId} API).

public getGrantedScopes(string|int $clientId, string $subject) : GrantedScopesGetResponse

A dedicated Authlete server provides a functionality to remember the set of scopes that an en-user has granted to a client application. A remembered set is NOT removed from the database even after all existing access tokens associated with the combination of the client application and the subject have expired. Note that this functionality is not provided by the shared Authlete server.

Parameters
$clientId : string|int

Client ID.

$subject : string

Subject (= unique identifier) of an end-user.

Tags
throws
AuthleteApiException
Return values
GrantedScopesGetResponse

Scopes granted to the client application by the end-user.

getService()

Get information about a service (= call Authlete's /api/service/get/{apiKey} API).

public getService(int|string $apiKey) : Service
Parameters
$apiKey : int|string

The API key of the service.

Tags
throws
AuthleteApiException
Return values
Service

Information about the service.

getServiceConfiguration()

Get the configuration of the service in JSON format that complies with OpenID Connect Discovery 1.0 (= call Authlete's /api/service/configuration API).

public getServiceConfiguration([bool $pretty = true ]) : string

The value returned from this method can be used as the response body of responses returned from /.well-known/openid-configuration. See "4. Obtaining OpenID Provider Configuration Information" of OpenID Connect Discovery 1.0 for details.

Parameters
$pretty : bool = true

true to get the JSON in pretty format. This argument is optional and its default value is true.

Tags
throws
AuthleteApiException
see
https://openid.net/specs/openid-connect-discovery-1_0.html

OpenID Connect Discovery 1.0

Return values
string

The configuration of the service in JSON format.

getServiceJwks()

Get the JWK Set of a service (= call Authlete's /api/service/jwks/get API).

public getServiceJwks([bool $pretty = false ][, bool $includePrivateKeys = false ]) : string
Parameters
$pretty : bool = false

true to get the JSON in pretty format. This argument is optional and its default value is false.

$includePrivateKeys : bool = false

true to include private keys in the JSON. false to exclude private keys from the JSON. This argument is optional and its default value is false.

Tags
throws
AuthleteApiException
Return values
string

JSON representation of the JWK Set of the service.

getServiceList()

Get a list of services that belong to the service owner (= call Authlete's /api/service/get/list API).

public getServiceList(int $start[, int $end = 5 ]) : ServiceListResponse

The pair of $start and $end parameters denotes the range of the result set of the query. For example, if $start is 5 and $end is 7, the pair makes a range from 5 (inclusive) to 7 (exclusive) and the response will contain (at most) 2 pieces of service information, i.e., information about the 6th and the 7th services (the index starts from 0).

If ($end - $start) is equal to or less than 0, getServices() method of the response (\Authlete\Dto\ServiceListResponse) returns null. But even in such a case, getTotalCount() method returns the total count. In other words, if you want to get just the total count, you can write the code as shown below.

// Call /api/service/get/list API.
$response = $api->getServiceList(0, 0);

// Get the number of services.
$totalCount = $response->getTotalCount();
Parameters
$start : int

The start index (inclusive) of the result set of the query. Must not be negative. This argument is optional and its default value is 0.

$end : int = 5

The end index (exclusive) of the result set of the query. Must not be negative. This argument is optional and its default value is 5.

Tags
throws
AuthleteApiException
Return values
ServiceListResponse

A list of services.

getSettings()

The settings of this AuthleteApi implementation.

public getSettings() : Settings
Return values
Settings

The settings of this AuthleteApi implementation.

refreshClientSecret()

Refresh the client secret of a client (= call Authlete's /api/client/secret/refresh/{clientId} API).

public refreshClientSecret(int|string $clientId) : ClientSecretRefreshResponse

A new value of the client secret will be generated by the Authlete server. If you want to specify a new value, use updateClientSecret() method.

Parameters
$clientId : int|string

Client ID.

Tags
throws
AuthleteApiException
Return values
ClientSecretRefreshResponse

The client secret.

tokenDelete()

Delete an access token (= call Authlete's /api/auth/token/delete/{token} API).

public tokenDelete(string $token) : mixed
Parameters
$token : string

An access token or its hash value.

Tags
throws
AuthleteApiException
since
1.9
Return values
mixed

updateClient()

Update a client (= call Authlete's /api/client/update/{clientId} API).

public updateClient(Client $client) : Client
Parameters
$client : Client

Information about a client you want to update. The getClientId() method of $client must return the correct client ID of the client.

Tags
throws
AuthleteApiException
Return values
Client

Information about the updated client.

updateClientAuthorization()

Update attributes of all existing access tokens issued to the client application by the end-user (= call Authlete's /api/client/authorization/update/{clientId} API).

public updateClientAuthorization(int|string $clientId, ClientAuthorizationUpdateRequest $request) : ApiResponse
Parameters
$clientId : int|string

Client ID.

$request : ClientAuthorizationUpdateRequest

Request parameters passed to the Authlete API.

Tags
throws
AuthleteApiException
Return values
ApiResponse

The result of the API call.

updateClientSecret()

Update the client secret of a client (= call Authlete's /api/client/secret/update/{clientId} API).

public updateClientSecret(int|string $clientId, string $clientSecret) : ClientSecretUpdateResponse

If you want to have the Authlete server generate a new value of the client secret, use refreshClientSecret() method.

Valid characters for a client secret are A-Z, a-z, 0-9, -, and _. The maximum length of a client secret is 86.

Parameters
$clientId : int|string

Client ID.

$clientSecret : string

A new value of client secret.

Tags
throws
AuthleteApiException
Return values
ClientSecretUpdateResponse

The client secret.

updateService()

Update a service (= call Authlete's /api/service/update/{apiKey} API).

public updateService(Service $service) : Service
Parameters
$service : Service

Information about a service to update. The getApiKey() method of the argument must return the correct API key of the service.

Tags
throws
AuthleteApiException
Return values
Service

Information about the updated service.

Search results