glgeorgiev / laravel-oauth2-client

OAuth2 Client for Laravel. With a single custom provider. Dependent on https://github.com/thephpleague/oauth2-client
MIT License
4 stars 6 forks source link

hi, how to implement and how to use the package on laravel 5.1 #1

Open chandzul opened 9 years ago

glgeorgiev commented 9 years ago

For now, the package is available only for dev. First of all it is meant to work with https://github.com/glgeorgiev/laravel-oauth2-server And you must setup the server application first, then comes the client app. And the main role is to be a SSO provider. If this is what you need, follow these steps:

  1. Require the package in composer with adding in the require-dev of the composer.json file the line:
"glgeorgiev/laravel-oauth2-client": "1.*",
  1. Register the provider in the config/app.php file:
GLGeorgiev\LaravelOAuth2Client\OAuthClientServiceProvider::class,
  1. Register the middleware in the app/Http/Kernel.php file (in the $middleware array):
GLGeorgiev\LaravelOAuth2Client\Http\Middleware\FirstTimeAuthCheck::class,
  1. You can publish the config file, or maybe just fill out some variables in the .env file, like:
URL_AUTHORIZE
URL_ACCESS_TOKEN

You can see them in the config file.

Basically that is all.

And like I said you'll need to install the server package before this, so you can fill the data in the .env file. These days, I'll update the README file both for the client and server package.

Cheers!

gumplei commented 8 years ago

Always get Invalid state! errror. The state can't save in session.