GithubHelp home page GithubHelp logo

matthewpennell / eveonline-socialite-sisi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nullx27-org/eveonline-socialite

0.0 2.0 0.0 12 KB

Eve Online provider for Laravel Socialite (Singularity fork)

License: MIT License

PHP 100.00%

eveonline-socialite-sisi's Introduction

Eve Online Provider for Laravel Socialite (Singularity fork)

This provider is forked from https://github.com/nullx27/eveonline-socialite and modified for use with the Singularity test oAuth server and API.

Installation and config

Install Laravel Socialite (see here: https://github.com/laravel/socialite/blob/2.0/readme.md)

Install the eveonline socialite (sisi) provider

composer require matthewpennell/eveonline-socialite-sisi

Add the following to your .env file:

TESTEVEONLINE_CLIENT_ID=
TESTEVEONLINE_CLIENT_SECRET=
TESTEVEONLINE_REDIRECT=

(Get your Eve Online SSO credentials here: https://developers.testeveonline.com/applications/ - note that this is the Singularity version of the developers site)

Laravel <= 5.4

Add the following to your config/app.php

matthewpennell\Socialite\EveOnline\EveOnlineServiceProvider::class,

Laravel 5.5

Service Provider is auto discovered.

Usage

<?php

namespace App\Http\Controllers\Auth;

use Socialite;

class AuthController extends Controller
{
    /**
     * Redirect the user to the Eve Online authentication page.
     *
     * @return Response
     */
    public function redirectToProvider()
    {
        return Socialite::driver('eveonline-sisi')->redirect();
    }

    /**
     * Obtain the user information from Eve Online.
     *
     * @return Response
     */
    public function handleProviderCallback()
    {
        $user = Socialite::driver('eveonline-sisi')->user();

        //dd($user);
    }
}

Retrieving User Details

Once you have a user instance, you can grab a few more details about the user:

$user = Socialite::driver('eveonline-sisi')->user();

$token = $user->token;
$expiresIn = $user->expiresIn;
$user->getId();
$user->getName();
$user->getAvatar();

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.