successgo/success-auth

Make oauth login easy

v1.1 2020-02-23 10:24 UTC

This package is auto-updated.

Last update: 2024-10-27 15:50:25 UTC


README

Make auth login easy

Install

composer require "successgo/success-auth:^1.0" -vvv

Use

// build config
$config = \SuccessGo\SuccessAuth\Config\AuthConfigBuilder::builder()
    ->clientId('Client Id')
    ->clientSecret('Client Secret')
    ->redirectUri('Redirect Uri')
    ->build();

// build the auth request
$authRequest = new \SuccessGo\SuccessAuth\Request\AuthRequest\WechatOpenAuthRequest($config, new \SuccessGo\SuccessAuth\Config\AuthSource\WechatOpenAuthSource());

// build auth callback
$authCallback = \SuccessGo\SuccessAuth\Model\AuthCallbackBuilder::builder()->code('Code')->build();

// get the auth response
$authResponse = $authRequest->login($authCallback);

if ($authResponse->isOk()) {
    // Do your business here
}

Acknowledgement

LICENSE

See https://successgo.mit-license.org