PHP серверная часть ouath2 - PullRequest
       1

PHP серверная часть ouath2

0 голосов
/ 23 сентября 2019

Я хочу использовать oauth2 для приложения

Для client side Я использую следующий код:

$provider = new \League\OAuth2\Client\Provider\GenericProvider([
    'clientId'                => 'xxx',
    'clientSecret'            => 'xxx',
    'redirectUri'             => 'http://my-site.com/redirect-url/',
    'urlAuthorize'            => 'http://my-site.com/oauth2/lockdin/authorize',
    'urlAccessToken'          => 'http://my-site.com/oauth2/lockdin/token',
    'urlResourceOwnerDetails' => 'http://my-site.com/oauth2/lockdin/resource'
]);

Для создания нового токена я должен отправить запрос на my-site.com

Но я не могу найти server side php коды для oauth2

Где я могу найти oauth2/lockdin/authorize или oauth2/lockdin/token коды?

Я нахожу этот код:

// Setup the authorization server
        $server = new AuthorizationServer(
            new ClientRepository(),                 // instance of ClientRepositoryInterface
            new AccessTokenRepository(),            // instance of AccessTokenRepositoryInterface
            new ScopeRepository(),                  // instance of ScopeRepositoryInterface
            'file://'.__DIR__.'/../private.key',    // path to private key
            'file://'.__DIR__.'/../public.key'      // path to public key
        );

Но где я использую cliendtId или clientSecert?!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...