AuthleteApi
Authlete API.
Tags
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
authorization()
Call Authlete's /api/auth/authorization API.
public
authorization(AuthorizationRequest $request) : AuthorizationResponse
Parameters
- $request : AuthorizationRequest
-
Request parameters passed to the API.
Tags
Return values
AuthorizationResponse —Response from the API.
authorizationFail()
Call Authlete's /api/auth/authorization/fail API.
public
authorizationFail(AuthorizationFailRequest $request) : AuthorizationFailResponse
Parameters
- $request : AuthorizationFailRequest
-
Request parameters passed to the API.
Tags
Return values
AuthorizationFailResponse —Response from the API.
authorizationIssue()
Call Authlete's /api/auth/authorization/issue API.
public
authorizationIssue(AuthorizationIssueRequest $request) : AuthorizationIssueResponse
Parameters
- $request : AuthorizationIssueRequest
-
Request parameters passed to the API.
Tags
Return values
AuthorizationIssueResponse —Response from the API.
backchannelAuthentication()
Call Authlete's /api/backchannel/authentication API.
public
backchannelAuthentication(BackchannelAuthenticationRequest $request) : BackchannelAuthenticationResponse
Parameters
- $request : BackchannelAuthenticationRequest
-
Request parameters passed to the API.
Tags
Return values
BackchannelAuthenticationResponse —Response from the API.
backchannelAuthenticationComplete()
Call Authlete's /api/backchannel/authentication/complete API.
public
backchannelAuthenticationComplete(BackchannelAuthenticationCompleteRequest $request) : BackchannelAuthenticationCompleteResponse
Parameters
- $request : BackchannelAuthenticationCompleteRequest
-
Request parameters passed to the API.
Tags
Return values
BackchannelAuthenticationCompleteResponse —Response from the API.
backchannelAuthenticationFail()
Call Authlete's /api/backchannel/authentication/fail API.
public
backchannelAuthenticationFail(BackchannelAuthenticationFailRequest $request) : BackchannelAuthenticationFailResponse
Parameters
- $request : BackchannelAuthenticationFailRequest
-
Request parameters passed to the API.
Tags
Return values
BackchannelAuthenticationFailResponse —Response from the API.
backchannelAuthenticationIssue()
Call Authlete's /api/backchannel/authentication/issue API.
public
backchannelAuthenticationIssue(BackchannelAuthenticationIssueRequest $request) : BackchannelAuthenticationIssueResponse
Parameters
- $request : BackchannelAuthenticationIssueRequest
-
Request parameters passed to the API.
Tags
Return values
BackchannelAuthenticationIssueResponse —Response from the API.
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
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
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
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
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
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
Return values
mixed —deviceAuthorization()
Call Authlete's /api/device/authorization API.
public
deviceAuthorization(DeviceAuthorizationRequest $request) : DeviceAuthorizationResponse
Parameters
- $request : DeviceAuthorizationRequest
-
Request parameters passed to the API.
Tags
Return values
DeviceAuthorizationResponse —Response from the API.
deviceComplete()
Call Authlete's /api/device/complete API.
public
deviceComplete(DeviceCompleteRequest $request) : DeviceCompleteResponse
Parameters
- $request : DeviceCompleteRequest
-
Request parameters passed to the API.
Tags
Return values
DeviceCompleteResponse —Response from the API.
deviceVerification()
Call Authlete's /api/device/verification API.
public
deviceVerification(DeviceVerificationRequest $request) : DeviceVerificationResponse
Parameters
- $request : DeviceVerificationRequest
-
Request parameters passed to the API.
Tags
Return values
DeviceVerificationResponse —Response from the API.
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
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
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 isnull
. - $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
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
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
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 istrue
.
Tags
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 isfalse
. - $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 isfalse
.
Tags
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
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.
introspection()
Call Authlete's /api/auth/introspection API.
public
introspection(IntrospectionRequest $request) : IntrospectionResponse
Parameters
- $request : IntrospectionRequest
-
Request parameters passed to the API.
Tags
Return values
IntrospectionResponse —Response from the API.
pushAuthorizationRequest()
Call Authlete's /api/pushed_auth_req API.
public
pushAuthorizationRequest(PushedAuthReqRequest $request) : PushedAuthReqResponse
Parameters
- $request : PushedAuthReqRequest
-
Request parameters passed to the API.
Tags
Return values
PushedAuthReqResponse —Response from the API.
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
Return values
ClientSecretRefreshResponse —The client secret.
revocation()
Call Authlete's /api/auth/revocation API.
public
revocation(RevocationRequest $request) : RevocationResponse
Parameters
- $request : RevocationRequest
-
Request parameters passed to the API.
Tags
Return values
RevocationResponse —Response from the API.
standardIntrospection()
Call Authlete's /api/auth/introspection/standard API.
public
standardIntrospection(StandardIntrospectionRequest $request) : StandardIntrospectionResponse
Parameters
- $request : StandardIntrospectionRequest
-
Request parameters passed to the API.
Tags
Return values
StandardIntrospectionResponse —Response from the API.
token()
Call Authlete's /api/auth/token API.
public
token(TokenRequest $request) : TokenResponse
Parameters
- $request : TokenRequest
-
Request parameters passed to the API.
Tags
Return values
TokenResponse —Response from the API.
tokenCreate()
Call Authlete's /api/auth/token/create API.
public
tokenCreate(TokenCreateRequest $request) : TokenCreateResponse
Parameters
- $request : TokenCreateRequest
-
Request parameters passed to the API.
Tags
Return values
TokenCreateResponse —Response from the API.
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
Return values
mixed —tokenFail()
Call Authlete's /api/auth/token/fail API.
public
tokenFail(TokenFailRequest $request) : TokenFailResponse
Parameters
- $request : TokenFailRequest
-
Request parameters passed to the API.
Tags
Return values
TokenFailResponse —Response from the API.
tokenIssue()
Call Authlete's /api/auth/token/issue API.
public
tokenIssue(TokenIssueRequest $request) : TokenIssueResponse
Parameters
- $request : TokenIssueRequest
-
Request parameters passed to the API.
Tags
Return values
TokenIssueResponse —Response from the API.
tokenUpdate()
Call Authlete's /api/auth/token/update API.
public
tokenUpdate(TokenUpdateRequest $request) : TokenUpdateResponse
Parameters
- $request : TokenUpdateRequest
-
Request parameters passed to the API.
Tags
Return values
TokenUpdateResponse —Response from the API.
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
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
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
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
Return values
Service —Information about the updated service.
userInfo()
Call Authlete's /api/auth/userinfo API.
public
userInfo(UserInfoRequest $request) : UserInfoResponse
Parameters
- $request : UserInfoRequest
-
Request parameters passed to the API.
Tags
Return values
UserInfoResponse —Response from the API.
userInfoIssue()
Call Authlete's /api/auth/userinfo/issue API.
public
userInfoIssue(UserInfoIssueRequest $request) : UserInfoIssueResponse
Parameters
- $request : UserInfoIssueRequest
-
Request parameters passed to the API.
Tags
Return values
UserInfoIssueResponse —Response from the API.