]> git.mxchange.org Git - friendica.git/blob - src/Security/OAuth1/OAuthToken.php
Fix notices
[friendica.git] / src / Security / OAuth1 / OAuthToken.php
1 <?php
2
3 namespace Friendica\Security\OAuth1;
4
5 class OAuthToken
6 {
7         // access tokens and request tokens
8         public $key;
9         public $secret;
10
11         public $expires;
12         public $scope;
13         public $uid;
14
15         /**
16          * key = the token
17          * secret = the token secret
18          *
19          * @param $key
20          * @param $secret
21          */
22         function __construct($key, $secret)
23         {
24                 $this->key    = $key;
25                 $this->secret = $secret;
26         }
27
28         /**
29          * generates the basic string serialization of a token that a server
30          * would respond to request_token and access_token calls with
31          */
32         function to_string()
33         {
34                 return "oauth_token=" .
35                            OAuthUtil::urlencode_rfc3986($this->key) .
36                            "&oauth_token_secret=" .
37                            OAuthUtil::urlencode_rfc3986($this->secret);
38         }
39
40         function __toString()
41         {
42                 return $this->to_string();
43         }
44 }