Download the PHP package friendsofhyperf/oauth2-server without Composer
On this page you can find all versions of the php package friendsofhyperf/oauth2-server. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download friendsofhyperf/oauth2-server
More information about friendsofhyperf/oauth2-server
Files in friendsofhyperf/oauth2-server
Download friendsofhyperf/oauth2-server
More information about friendsofhyperf/oauth2-server
Files in friendsofhyperf/oauth2-server
Vendor friendsofhyperf
Package oauth2-server
Short Description The Oauth2 server for hyperf.
License MIT
Package oauth2-server
Short Description The Oauth2 server for hyperf.
License MIT
Please rate this library. Is it a good library?
Informations about the package oauth2-server
FriendsOfHyperf OAuth2 Server
中文说明
A complete OAuth2 server implementation for Hyperf framework, based on league/oauth2-server.
Features
- Full OAuth2 server implementation supporting:
- Client Credentials Grant
- Password Grant
- Refresh Token Grant
- Authorization Code Grant (with PKCE support)
- Built-in commands for:
- Client management (create/delete/list)
- Key pair generation
- Token cleanup
- Multiple storage backends (Eloquent ORM)
- Customizable token lifetimes
- Scope management
Installation
-
Install via Composer:
-
Publish configuration:
-
Generate encryption keys:
- Run migrations (if using database storage):
Configuration
Configure your OAuth2 server in config/autoload/oauth2-server.php:
Available Commands
| Command | Description |
|---|---|
oauth2-server:clear-expired-tokens |
Remove expired access/refresh tokens |
oauth2-server:create-client |
Create a new OAuth2 client |
oauth2-server:delete-client |
Delete an OAuth2 client |
oauth2-server:generate-keypair |
Generate private/public key pair |
oauth2-server:list-clients |
List all OAuth2 clients |
API Endpoints
Authorization Endpoint
GET /oauth/authorize
Token Endpoint
POST /oauth/token
Protected Resource
Using Middleware
Use ResourceServerMiddleware to protect your routes:
Using ResourceServer Directly
If you need to use the ResourceServer directly in your code:
Usage Example
In Your Code
Instead of directly injecting the OAuth2 server, you now need to use the factory to build it:
Client Management
-
Create a client:
- Request an access token (Password Grant):
License
MIT
All versions of oauth2-server with dependencies
PHP Build Version
Package Version
Requires
ext-openssl Version
*
hyperf/command Version ~3.2.0
hyperf/db-connection Version ~3.2.0
hyperf/di Version ~3.2.0
league/oauth2-server Version ^9.2
hyperf/command Version ~3.2.0
hyperf/db-connection Version ~3.2.0
hyperf/di Version ~3.2.0
league/oauth2-server Version ^9.2
The package friendsofhyperf/oauth2-server contains the following files
Loading the files please wait ...