|
2 | 2 |
|
3 | 3 | Services may support additional features, such as token refresh or invalidation, among other things. You can add these features |
4 | 4 | by implementing one or more of the feature interfaces. Some of the methods for these interfaces are already implemented in the |
5 | | -abstract providers, so that you only rarely need to re-implement them. |
| 5 | +abstract providers, so that you only rarely need to re-implement them - for others, especially newer RFCs, there are traits that can be used. |
6 | 6 |
|
7 | 7 |
|
8 | 8 | ## `UserInfo` |
@@ -82,9 +82,9 @@ The `ClientCredentials` interface indicates that the provider supports the OAuth |
82 | 82 | This allows the creation of access tokens without user context via the method `ClientCredentials::getClientCredentialsToken()` that is already implemented in `OAuth2Provider`. |
83 | 83 | Similar to the user authorization request, an optional set of scopes can be supplied via the `$scopes` parameter. |
84 | 84 |
|
85 | | - |
86 | 85 | ```php |
87 | 86 | class MyOAuth2Provider extends OAuth2Provider implements ClientCredentials{ |
| 87 | + use ClientCredentialsTrait; |
88 | 88 |
|
89 | 89 | /* |
90 | 90 | * ... |
@@ -181,6 +181,7 @@ If you need to override either of the aforementioned request methods, don't forg |
181 | 181 |
|
182 | 182 | ```php |
183 | 183 | class MyOAuth2Provider extends OAuth2Provider implements PKCE{ |
| 184 | + use PKCETrait; |
184 | 185 |
|
185 | 186 | /* |
186 | 187 | * ... |
@@ -243,6 +244,7 @@ In case the service needs additional parameters in the final authorization URL, |
243 | 244 |
|
244 | 245 | ```php |
245 | 246 | class MyOAuth2Provider extends OAuth2Provider implements PAR{ |
| 247 | + use PARTrait; |
246 | 248 |
|
247 | 249 | /* |
248 | 250 | * ... |
@@ -279,6 +281,7 @@ The implementation in `OAuth2Provider` is divided in parts that can be overridde |
279 | 281 |
|
280 | 282 | ```php |
281 | 283 | class MyOAuth2Provider extends OAuth2Provider implements TokenInvalidate{ |
| 284 | + use TokenInvalidateTrait; |
282 | 285 |
|
283 | 286 | /* |
284 | 287 | * ... |
@@ -323,6 +326,7 @@ This can be solved by simply cloning the current provider instance, feed the giv |
323 | 326 |
|
324 | 327 | ```php |
325 | 328 | class MyOAuth2Provider extends OAuth2Provider implements TokenInvalidate{ |
| 329 | + use TokenInvalidateTrait; |
326 | 330 |
|
327 | 331 | /* |
328 | 332 | * ... |
|
0 commit comments