chornthorn/wso2-is

WSO2 Identity Server OAuth2 Provider for Laravel Socialite

v1.0.7 2023-09-01 08:11 UTC

This package is auto-updated.

Last update: 2024-10-30 02:21:41 UTC


README

Latest Version on Packagist GitHub issues-closed Total Downloads

composer require chornthorn/wso2-is

Installation & Basic Usage

Please see the Base Installation Guide, then follow the provider specific instructions below.

Add configuration to config/services.php

'wso2is' => [
  'client_id' => env('WSO2IS_CLIENT_ID'),
  'client_secret' => env('WSO2IS_CLIENT_SECRET'),
  'redirect' => env('WSO2IS_REDIRECT_URI'),
  'base_url' => env('WSO2IS_BASE_URL'),
],

Add configuration to .env

Login to your WSO2 Identity Server and create a new OAuth2 application. And then add the following configuration to your .env file.

WSO2IS_CLIENT_ID=your-client-id
WSO2IS_CLIENT_SECRET=your-client-secret
WSO2IS_REDIRECT_URI=https://your-callback-url
WSO2IS_BASE_URL=https://your-identity-server.com/oauth2

Add provider event listener

Configure the package's listener to listen for SocialiteWasCalled events.

Add the event to your listen[] array in app/Providers/EventServiceProvider. See the Base Installation Guide for detailed instructions.

protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
         \SocialiteProviders\WSO2IS\Wso2IsExtendSocialite::class . '@handle',
    ],
];

Usage

You should now be able to use the provider like you would regularly use Socialite (assuming you have the facade installed):

return Socialite::driver('wso2is')->redirect();

Returned User fields

  • id
  • nickname
  • name
  • email