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
null
Details- Type
- string


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


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


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


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


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


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


authorizeApplication(
$clientId, $endPointUri, $clientSecret
=
null
)
:
bool
Validates 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
)
:
void
Authorizes this application for a user
Name | Type | Description |
---|---|---|
$user | \eZUser |


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


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


isAuthorizedByUser(
mixed $scope, \eZUser $user
=
null
)
:
bool
Checks 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
)
:
bool
Validates 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 |