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
2020``` php
2121<?php
2222
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+
2329$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+ ) */
2935);
3036
3137// Pass it a PSR-7 request and it returns a signed PSR7 request you can use in any PSR7 capable HTTP client.
3238$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')
3541)->sign($request);
3642```
3743
You can’t perform that action at this time.
0 commit comments