Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce refresh and revoke interfaces for OAuth2 providers #218

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/Contracts/OAuth2/RefreshTokensInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace SocialiteProviders\Manager\Contracts\OAuth2;

use Laravel\Socialite\Two\ProviderInterface as SocialiteOauth2ProviderInterface;
use Psr\Http\Message\ResponseInterface;

interface RefreshTokensInterface extends SocialiteOauth2ProviderInterface
{
/**
* @param string $refreshToken
* @return ResponseInterface
*/
public function refreshToken(string $refreshToken) : ResponseInterface;

/**
* @param string $refreshToken
* @return array
*/
public function getRefreshTokenResponse(string $refreshToken) : array;
}
23 changes: 23 additions & 0 deletions src/Contracts/OAuth2/RevokeTokensInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace SocialiteProviders\Manager\Contracts\OAuth2;

use Laravel\Socialite\Two\ProviderInterface as SocialiteOauth2ProviderInterface;
use Psr\Http\Message\ResponseInterface;

interface RevokeTokensInterface extends SocialiteOauth2ProviderInterface
{
/**
* @param string $token
* @param string $hint optional hint, either 'access_token' or 'refresh_token'
* @return ResponseInterface
*/
public function revokeToken(string $token, string $hint = '') : ResponseInterface;

/**
* @param string $token
* @param string $hint optional hint, either 'access_token' or 'refresh_token'
* @return array
*/
public function getRevokeTokenResponse(string $token, string $hint = '') : array;
}