File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -20,18 +20,24 @@ composer require api-clients/psr7-oauth1
20
20
``` php
21
21
<?php
22
22
23
+ use ApiClients\Tools\Psr7\Oauth1\Definition;
24
+ use ApiClients\Tools\Psr7\Oauth1\RequestSigning\RequestSigner;
25
+ use ApiClients\Tools\Psr7\Oauth1\Signature\HmacSha1Signature;
26
+
27
+ $consumerSecret = new Definition\ConsumerSecret('consumer_secret');
28
+
23
29
$requestSigner = new RequestSigner(
24
- new ConsumerKey('consumer_key'),
25
- new ConsumerSecret('consumer_secret') ,
26
- new HmacSha1Signature( /**
27
- new ConsumerSecret('consumer_secret') * Optional, but allows for other than SHA1 signatures
28
- ) */
30
+ new Definition\ ConsumerKey('consumer_key'),
31
+ $consumerSecret ,
32
+ new HmacSha1Signature(/**
33
+ $consumerSecret * Optional, but allows for other than HMAC SHA1 signatures
34
+ ) */
29
35
);
30
36
31
37
// Pass it a PSR-7 request and it returns a signed PSR7 request you can use in any PSR7 capable HTTP client.
32
38
$request = $requestSigner->withAccessToken(
33
- new AccessToken('token_key'),
34
- new TokenSecret('token_secret')
39
+ new Definition\ AccessToken('token_key'),
40
+ new Definition\ TokenSecret('token_secret')
35
41
)->sign($request);
36
42
```
37
43
You can’t perform that action at this time.
0 commit comments