Setting up a new provider is a fairly straight forward task. You will need to do some leg work before you get started though.
services.php
and users.php
config files.<your site>/callback/<provider>
when you sign up..env
. They normally follow the convention of [PROVIDER]_CLIENT_KEY
(as an example).config/services.php
.config/jumpgate/users.php
. (You can use the example config below)This is the basic workflow. After this, most APIs will work for authentication. You can set scopes
and extras
in the
users.php
config if your API uses them. These behave the exact way Laravel Socialite expects those values to.
Below you will find an example set up assuming you were authenticating through google.
{info} You can see how to generate a google API in our docs
.env
GOOGLE_KEY="SOME+KEY.apps.googleusercontent.com"
GOOGLE_SECRET="SOME+SECRET"
GOOGLE_REDIRECT_URI="http://mysite.lol/callback/google"
config/services.php
'google' => [
'client_id' => env('GOOGLE_KEY'),
'client_secret' => env('GOOGLE_SECRET'),
'redirect' => env('GOOGLE_REDIRECT_URI'),
],
config/jumpgate/users.php
'providers' => [
[
'driver' => 'google',
'scopes' => [
'https://www.googleapis.com/auth/userinfo.email',
],
'extras' => [
'approval_prompt' => 'auto',
'access_type' => 'offline',
],
],
[
'driver' => 'github',
'scopes' => [],
'extras' => [],
],
],