Download the PHP package mrstebo/laravel-socialite-xero without Composer
On this page you can find all versions of the php package mrstebo/laravel-socialite-xero. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mrstebo/laravel-socialite-xero
More information about mrstebo/laravel-socialite-xero
Files in mrstebo/laravel-socialite-xero
Package laravel-socialite-xero
Short Description Xero OAuth2 Provider for Laravel Socialite
License MIT
Informations about the package laravel-socialite-xero
Laravel-Socialite-Xero
Xero OAuth2 Provider for Laravel Socialite
This package allows you to use Laravel Socialite using Xero.
Installation
You can install the package via composer:
Note: if you use Laravel 5.5+ you can skip service provider registration, because it should be auto discovered.
Then you should register service provider in your config/app.php
file:
You will also need to add credentials for the OAuth application that you can get using the Xero Developers Portal. They should be placed in your config/services.php
file. You may copy the example configuration below to get started:
Basic usage
So now, you are ready to authenticate users! You will need two routes: one for redirecting the user to the OAuth provider, and another for receiving the callback from the provider after authentication. We will access Socialite using the Socialite facade:
Of course, you will need to define routes to your controller methods:
The redirect method takes care of sending the user to the OAuth provider, while the user method will read the incoming request and retrieve the user's information from the provider.
Retrieving user details
Once you have a user instance, you can grab a few more details about the user: