Git Product home page Git Product logo

doximity's Introduction

Doximity

Laravel SocialiteProviders for Doximity. For more information about doximity read https://www.doximity.com/developers/documentation

Usage

Laravel SocialiteProviders for Doximity. It helps to integrate doximity's OAuth authorization to your laravel application.

Installation

  1. Add Socialite and this Doximity api through composer
  2. Add Socialite to Providers array in your config/app.php
'providers' => [
    // Other service providers...

    Laravel\Socialite\SocialiteServiceProvider::class,
],

Also, add the Socialite facade to the aliases array in your app configuration file:

'Socialite' => Laravel\Socialite\Facades\Socialite::class,

3.Add credentials for the Doximity OAuth services in your config/services.php

'doximity' => [
    'client_id' => 'your-doximity-app-id',
    'client_secret' => 'your-doximity-app-secret',
    'redirect' => 'http://your-app-callback-url-here',
],

4.Next extend Socialite to add Doximity into it. Plcae this function inside your AppServiceProvider.php

private function addDoximityToSocialite()
{
    $socialite = $this->app->make('Laravel\Socialite\Contracts\Factory');
    $socialite->extend(
        'doximity',
        function ($app) use ($socialite) {
            $config = $app['config']['services.doximity'];
            return $socialite->buildProvider(\Doximity\Provider::class, $config);
        }
    );
}

Call this function inside boot() of AppServiceProvider.php

public function boot()
{
    $socialite = $this->app->addDoximityToSocialite();
}
  1. Create a controller for doximity login add add folowing functions
public function redirectToProvider()
{
    return Socialize::driver('doximity')->redirect();
}

public function handleCallback()
{
    $user = Socialize::driver('doximity')->user();
}
  1. Create routes for those methods
$router->get('/login/doximity', 'App\Controllers\Auth\DoximityController@redirectToProvider')
        ->name('login.doximity');

$router->get('/login/doximity/response', 'App\Controllers\Auth\DoximityController@handleCallback')
        ->name('login.doximity.response');

7 Your are ready to use doximity login. For more information read Socialite and Doximity documentation

License

MIT (see LICENSE file)

Free Software, Hell Yeah!

doximity's People

Contributors

sankaran8 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.