-
Notifications
You must be signed in to change notification settings - Fork 941
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7cec8ba
commit 9b6c7a7
Showing
3 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
|
||
namespace Laravel\Socialite\Two; | ||
|
||
class Token | ||
{ | ||
/** | ||
* The user's access token. | ||
* | ||
* @var string | ||
*/ | ||
public $token; | ||
|
||
/** | ||
* The refresh token that can be exchanged for a new access token. | ||
* | ||
* @var string | ||
*/ | ||
public $refreshToken; | ||
|
||
/** | ||
* The number of seconds the access token is valid for. | ||
* | ||
* @var int | ||
*/ | ||
public $expiresIn; | ||
|
||
/** | ||
* The scopes the user authorized. The approved scopes may be a subset of the requested scopes. | ||
* | ||
* @var array | ||
*/ | ||
public $approvedScopes; | ||
|
||
/** | ||
* Set the token on the user. | ||
* | ||
* @param string $token | ||
* @return $this | ||
*/ | ||
public function setToken($token) | ||
{ | ||
$this->token = $token; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Set the refresh token required to obtain a new access token. | ||
* | ||
* @param string $refreshToken | ||
* @return $this | ||
*/ | ||
public function setRefreshToken($refreshToken) | ||
{ | ||
$this->refreshToken = $refreshToken; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Set the number of seconds the access token is valid for. | ||
* | ||
* @param int $expiresIn | ||
* @return $this | ||
*/ | ||
public function setExpiresIn($expiresIn) | ||
{ | ||
$this->expiresIn = $expiresIn; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Set the scopes that were approved by the user during authentication. | ||
* | ||
* @param array $approvedScopes | ||
* @return $this | ||
*/ | ||
public function setApprovedScopes($approvedScopes) | ||
{ | ||
$this->approvedScopes = $approvedScopes; | ||
|
||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters