Giter Site home page Giter Site logo

oauth2-eeyes's Introduction

OAuth2.0-eeyes

标签: Provider OAuth2.0 eeyes-net php


  • 这是一个基于 thephpleague/oauth2.0-client 的 OAuth2.0 客户端 Provider

  • 其中主要的配置内容已经为e瞳网用户账户中心的 OAuth2.0 服务器进行了配置,在使用时,请新建好配置文件以备引用。


安装

请使用 composer 来安装

composer require sxxuz/oauth2-eeyes

使用

使用方法与 League/OAuth2.0-Client 基本相同

认证流程

请务必保证重定向地址正确,即保证重定向返回后会执行getUser

        // 创建一个Eeyes对象

        $eeyesClient = new Eeyes([

            'clientId'      => 'Your App ID Here',

            'clientSecret'  => 'Your App Secret Here',

            'redirectUri'   => 'Your Callback Url Here',

            'scope'	        => [
                'scope1',
                'scope2',
                'scope3'
            ]

        ]);

        // 使用getUser方法获取用户的信息,登录、验证过程均会自动完成

        $user = $eeyesClient->getUser();

获取用户信息

当获取到 Token 后,使用 Token 来取得用户信息
        // 假设之前已经执行过$user = $eeyesClient->getUser();
        
        // 获取用户的NetID

        $username = $user['username'];

        // 获取用户的姓名

        $name = $user['name'];

License

The MIT License(MIT). Please see License File for more information.

oauth2-eeyes's People

Contributors

xuzhixuan avatar

Watchers

James Cloos avatar Finn 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.