Download the PHP package digitive/vipps-socialite-provider without Composer
On this page you can find all versions of the php package digitive/vipps-socialite-provider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download digitive/vipps-socialite-provider
More information about digitive/vipps-socialite-provider
Files in digitive/vipps-socialite-provider
Package vipps-socialite-provider
Short Description Vipps OAuth2 Provider for Laravel Socialite
License MIT
Informations about the package vipps-socialite-provider
Socialite Provider for Vipps
1. Installation
2. Service Provider
Add to app.php:
3. Event Listener
- Add
SocialiteProviders\Manager\SocialiteWasCalled
event to yourlisten[]
array inapp/Providers/EventServiceProvider
.
Example:
4. Configuration setup
You will need to add vipps to the services configuration file so that after config files are cached for usage in production environment (Laravel command artisan config:cache
) all config is still available.
Add to config/services.php
.
Remember to whitelist the redirect_uri in the Vipps portal. Client ID and secret is also available in the Vipps portal.
5. Usage
- Laravel docs on configuration
- Guzzle version 7 or later is required
- You should now be able to use it like you would regularly use Socialite (assuming you have the facade installed):
To initiate the Vipps login, add this to your controller
You've now gotten a user token from Vipps in your callback function. Now we need to use the user token to get the phone number of the authenticated user.
Example for a VippsAuthController:
If you need multiple redirect URLs you can define a redirect url in the controller.
Example for specified redirect URL:
The same goes for scopes
Example for specified scopes:
Vipps guidelines
- When using Vipps login you need to use the login button svgs provided by Vipps. Go to Vipps design guidelines for more info.
License
MIT © Digitive AS