Goal: Implement a service that simply gets the oauth_code provided by a social provider and create a jwt token with the User object. The oauth_code must be provided in the request body so my lumen app does not try to authenticate a user, the client requesting to get a jwt token must provide the respective oauth_code in the request body.
Steps: I followed this documentation here https://socialiteproviders.netlify.com/providers/slack.html to add SlackProvider.
Blocker: For some reason I was not able to get the EventServiceProvider to work in Lumen so I instead extended the SocialManager provided in vendor directory and made reference to SlackProvider
class MyCustomSocialiteManager extends SocialiteManager
protected function createSlackDriver()
{
$config = config('services.slack');
return $this->buildProvider(
\SocialiteProviders\Slack\Provider::class, $config
);
}
}
While this works and does the job, I feel using the EventServiceProvider should be a cleaner approach but I ran into a number of problems I could not resolve using this approach. Has anyone here been able to successfully use this approach to add a custom SocialiteProvider to their Lumen app? Please share how ...