kernel/private/oauth/classes/restclient.php
File containing the ezpRestClient class.
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Business Use License Agreement Version 2.0
- Package
- kernel
- Version
- 4.6.0
\ezpRestClient
Persistent object class representing a REST application.
Constants
Properties

string
$client_id= 'null'
Application client ID, as used over oAuth to authentify the application
nullDetails- Type
- string

string
$client_secret= 'null'
Application client secret, as used over oAuth to authentify the application
nullDetails- Type
- string

int
$created= 'null'
Application creation date, as a unix timestamp
nullDetails- Type
- int

string
$endpoint_uri= 'null'
Application client endpoint URI. Used to validate the redirection URI requested by the authorize call.
nullDetails- Type
- string

int
$owner_id= 'null'
ID of the eZ Publish user who owns the application
nullDetails- Type
- int
Methods

__get(
string $propertyName
)
:
mixedeZPersistentObject wrapper method: handles "function attributes"
| Name | Type | Description |
|---|---|---|
| $propertyName | string |
| Type | Description |
|---|---|
| mixed |

attribute(
string $attributeName
)
:
mixedeZPersistentObject wrapper method
| Name | Type | Description |
|---|---|---|
| $attributeName | string |
| Type | Description |
|---|---|
| mixed |

authorizeApplication(
$clientId, $endPointUri, $clientSecret
=
null
)
:
boolValidates an authorization request by an application using the ID, redirection URI and secret if provided.
| Name | Type | Description |
|---|---|---|
| $clientId | ||
| $endPointUri | ||
| $clientSecret |
| Type | Description |
|---|---|
| bool | True if the app is valid, false if it isn't |
- Todo
- Enhance the return variable, as several status would be required. Exceptions, or constants ?
- string
- string
- string

authorizeFor(
\eZUser $user
=
null
)
:
voidAuthorizes this application for a user
| Name | Type | Description |
|---|---|---|
| $user | \eZUser |

fetchByClientId(
string $clientId
)
:
\ezpRestClientFetches a rest application using a client Id
| Name | Type | Description |
|---|---|---|
| $clientId | string |
| Type | Description |
|---|---|
| \ezpRestClient |

hasAttribute(
string $attributeName
)
:
booleZPersistentObject wrapper method
| Name | Type | Description |
|---|---|---|
| $attributeName | string |
| Type | Description |
|---|---|
| bool |

isAuthorizedByUser(
mixed $scope, \eZUser $user
=
null
)
:
boolChecks if this application has been authorized by the current user
| Name | Type | Description |
|---|---|---|
| $scope | mixed | The requested security scope |
| $user | \eZUser | The user to check authorization for. Will check for current user if not given. |
| Type | Description |
|---|---|
| bool |
- Todo
- Handle non-authorization using

isEndPointValid(
string $endPointUri
)
:
boolValidates an attempt (endpoint) redirect URI against the one configured for the client
| Name | Type | Description |
|---|---|---|
| $endPointUri | string |
| Type | Description |
|---|---|
| bool | true if the URI is valid, false otherwise |