oauth2-server-php | A library for implementing an OAuth2 Server in php | OAuth library

 by   bshaffer PHP Version: v1.13.0 License: MIT

kandi X-RAY | oauth2-server-php Summary

kandi X-RAY | oauth2-server-php Summary

oauth2-server-php is a PHP library typically used in Security, OAuth applications. oauth2-server-php has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

A library for implementing an OAuth2 Server in php
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              oauth2-server-php has a medium active ecosystem.
              It has 3182 star(s) with 942 fork(s). There are 212 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 240 open issues and 431 have been closed. On average issues are closed in 356 days. There are 27 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of oauth2-server-php is v1.13.0

            kandi-Quality Quality

              oauth2-server-php has 0 bugs and 0 code smells.

            kandi-Security Security

              oauth2-server-php has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              oauth2-server-php code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              oauth2-server-php is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              oauth2-server-php releases are available to install and integrate.
              oauth2-server-php saves you 4954 person hours of effort in developing the same functionality from scratch.
              It has 10432 lines of code, 858 functions and 113 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed oauth2-server-php and discovered the below as its top functions. This is intended to give you an instant insight into oauth2-server-php implemented functionality, and help decide if they suit your requirements.
            • Grant an access token
            • Validate the request
            • Get the SQL to create the database .
            • Get an access token parameter
            • Get headers from server
            • Add a storage
            • Verify resource request
            • Create the JWT payload
            • Generate an access token
            • Set a redirection
            Get all kandi verified functions for this library.

            oauth2-server-php Key Features

            No Key Features are available at this moment for oauth2-server-php.

            oauth2-server-php Examples and Code Snippets

            No Code Snippets are available at this moment for oauth2-server-php.

            Community Discussions

            QUESTION

            Composer install issue on prod, no issues on local enviroment
            Asked 2018-Oct-15 at 09:45

            Recently I unignored composer.lock along with package-lock.json (likely unrelated), and I changed our gulp deploy script to use composer install instead of composer update. Before pushing new code to prod servers I updated the lock files to the latest using composer update and npm update to make sure there was nothing weird in there from branch merges.

            However the gulp deployment script hit various issues, the most problematic of which was: "Requirements could not be resolved to an installable set of packages"

            gulp-tasks/deploy.js in its current state:

            ...

            ANSWER

            Answered 2018-Oct-15 at 09:45

            You should install and enable php-soap extension.

            Source https://stackoverflow.com/questions/52813238

            QUESTION

            In OpenID Connect, is it okay to pass an id token instead of an access token to a resource server for authorization?
            Asked 2018-Sep-07 at 09:38

            I'm considering to use id token instead of id token for authorization, so that resource servers can validate its sign and extract user id out of it. Is there any dowside to this method which I'm not aware of?

            I guess I cannot use verify endpoint if I throw away access token. For us, it doesn't matter which scope the user granted access to since both client app and OIDC's identity provider is owned by us.

            I'm using this library to implement an OAuth2 and OpenID server. https://github.com/bshaffer/oauth2-server-php

            ...

            ANSWER

            Answered 2018-Sep-07 at 09:38

            Usage of ID Token is intended for the client application. Client uses it to authenticate the end user. All this is made possible through claims ID Token transfer. And these claims are built into an JWT. In simple terms, ID Token is a self-contained token.

            Now, sharing of ID Token outside of client is okay if you control all intended parties. Think about a scenario in which you leak sensitive user information through ID Token. For example if ID Token contain a claim about gender which only intended for client to use. But when you share ID Token with a third party, you expose those sensitive information. It could be a crime if there are legal barriers.

            Another point is on ID Token validation. Hence ID Token targets the client, important claims such as aud is set accordingly. When you pass ID Token to a backend to be used, such validation could fail.

            There are two solutions. First is to use self contained access tokens. These days it is common to use JWT based access tokens. With them, you get the same solution. It will contain end user identity, scope values as well as token validation information. Azure AD use such approach - check this link.

            Second one is to use ID Token. Given that you control both front end and backend, my opinion is you are okay to use it. But be mindful about future extensions. Specially not to expose it to other parties.

            Source https://stackoverflow.com/questions/52213841

            QUESTION

            Protect routes with oauth2
            Asked 2018-Feb-13 at 15:36

            I want to protect my REST API by using an oauth2 authentication. I'm using bshaffer/oauth2-server-php in combination with zend 3.
            I've the following config:

            ...

            ANSWER

            Answered 2018-Feb-07 at 08:14

            There's no build-in system to make this. You will create a listener which's listens MvcEvent::Event_ROUTE and place it after router then check if there's a routematch. If there's one, check if it's protected route. If it's apply authentication logic.

            Source https://stackoverflow.com/questions/48647280

            QUESTION

            Delete expired tokens in oauth2-server-php
            Asked 2018-Jan-16 at 08:54

            I'm using the bshaffer/oauth2-server-php module to authenticate my rest api. Everything works fine but meanwhile I have over 20,000 access tokens in the database.
            As I read, the framework will not delete expired tokens automatically or by config parameter. So I'm trying to do the job by my own.
            I know the tables which hold the tokens and I already built the delete statements. But I can't find the right place (the right class/method) to hook with my cleanup routine.

            ...

            ANSWER

            Answered 2017-Nov-28 at 13:37

            I didn't read the complete source off bshaffer oauth server.
            But want you can try is to create your own class by extending from class Server.
            And use the __destruct() function to be executed when the object customServer is destroyed by PHP

            Source https://stackoverflow.com/questions/47532630

            QUESTION

            how to replace subject(sub) to a secret string in id_token at the openid connect?
            Asked 2018-Jan-02 at 11:04

            oauth2 library:

            https://github.com/Filsh/yii2-oauth2-server

            https://github.com/bshaffer/oauth2-server-php

            please notice that, user id in my system is a integer not a string.

            my purpose just hide system user id.

            the steps for id token :

            http://bshaffer.github.io/oauth2-server-php-docs/overview/openid-connect/

            { "iss": "localhost", "sub": 2, "aud": "-7IloKCawcvBwRijJeo7nsLxx1chC68L", "iat": 1514518157, "exp": 1514521757, "auth_time": 1514518157, "nonce": "dfsdsdsd" }

            md5('-7IloKCawcvBwRijJeo7nsLxx1chC68L' + 2) = 3C86CBBFF35AD3B6E609F5622D776531

            i wanna replace subject to md5(client_id + subject)

            { "iss": "localhost", "sub": "3C86CBBFF35AD3B6E609F5622D776531", "aud": "-7IloKCawcvBwRijJeo7nsLxx1chC68L", "iat": 1514516044, "exp": 1514519644, "auth_time": 1514516044, "nonce": "dfsdsdsd" }

            ...

            ANSWER

            Answered 2018-Jan-02 at 11:04

            IF I understand your desire, the OpenID Provider can provide anything for the Subject as long as it is Unique at that OpenID Provider for a specific relying party.

            OpenID Connect Identity Token Sub is a Subject Identifier is a locally unique and never re-assigned identifier within the Issuer for the Authenticated Entity, which is intended to be consumed by the OAuth Client.

            Two Subject Identifier types (subject_types_supported) are defined by OpenID Connect and are Required to be present in the OpenID Provider Metadata:

            public - provides the same sub (subject) value to all OAuth Client. It is the default if the provider has no subject_types_supported element in its discovery document.

            pairwise - provides a different Sub value to each OAuth Client, so as not to enable OAuth Client to correlate the End-User's activities without permission.

            The OpenID Connect Provider's OpenID Connect Discovery document SHOULD list its supported Subject Identifier types in the subject_types_supported element.

            If there is more than one type listed in the array, the OAuth Client MAY elect to provide its preferred identifier type using the subject_type parameter during Registration.

            Sub MUST NOT exceed 255 ASCII characters in length.

            Sub Sub value is a Case-sensitive string.

            Source https://stackoverflow.com/questions/48017114

            QUESTION

            How to extract user_id from JWT access_token (bshaffer oauth library)
            Asked 2017-Nov-07 at 10:01

            I followed JWT tutorial https://bshaffer.github.io/oauth2-server-php-docs/overview/jwt-access-tokens/

            I have created the access_token as follows:

            ...

            ANSWER

            Answered 2017-Nov-07 at 10:01

            QUESTION

            oauth2-server-php not returning refresh token
            Asked 2017-Apr-02 at 12:25

            Using this oauth2 library for PHP, I am validating a user via client_credentials like this:

            server.php

            ...

            ANSWER

            Answered 2017-Apr-01 at 23:17

            You must specify accessType: 'offline' in the OAuth2 options to receive a refresh token. If the former does not work try access_type: 'offline'.

            Source https://stackoverflow.com/questions/43160538

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install oauth2-server-php

            You can download it from GitHub.
            PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/bshaffer/oauth2-server-php.git

          • CLI

            gh repo clone bshaffer/oauth2-server-php

          • sshUrl

            git@github.com:bshaffer/oauth2-server-php.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular OAuth Libraries

            satellizer

            by sahat

            cpprestsdk

            by microsoft

            oauth2-server

            by thephpleague

            scribejava

            by scribejava

            socialite

            by laravel

            Try Top Libraries by bshaffer

            oauth2-demo-php

            by bshafferPHP

            oauth2-server-bundle

            by bshafferPHP

            php-echonest-api

            by bshafferPHP