oauth2-server/repository-interface-client.md

23 lines
1.0 KiB
Markdown
Raw Normal View History

2016-03-24 21:52:45 +05:30
---
layout: default
title: ClientRepositoryInterface documentation
permalink: /client-repository-interface/
---
# Client Repository Interface
## getClientEntity() : ClientEntityInterface
This method is called to validate a client's credentials.
The client secret may or may not be provided depending on the request sent by the client. The boolean `$mustValidateSecret` parameter will indicate whether or not the client secret must be validated. If the client is confidential (i.e. is capable of securely storing a secret) and `$mustValidateSecret === true` then the secret must be validated.
2016-03-24 21:52:45 +05:30
You can use the grant type to determine if the client is permitted to use the grant type.
If the client's credentials are validated you should return an instance of `\League\OAuth2\Server\Entities\Interfaces\ClientEntityInterface`
2017-03-15 19:44:48 +05:30
There are two traits you can use to help you implement some of the `ClientEntityInterface` methods:
* `\League\OAuth2\Server\Entities\Traits\ClientTrait`
2017-03-15 19:44:48 +05:30
* `\League\OAuth2\Server\Entities\Traits\EntityTrait`