Download the PHP package luchavez/passport-pgt-server without Composer

On this page you can find all versions of the php package luchavez/passport-pgt-server. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package passport-pgt-server

Passport Password Grant Tokens (PGC) Server for Laravel 8|9|10

Latest Version on Packagist Total Downloads GitHub Repo stars Discord Twitter Follow

Laravel Passport is an authentication package for Laravel. It is used by a lot of Laravel apps to authenticate users before accessing any resources. Basically, it generates an access token which you can then use on every request to provide identification to the OAuth Server.

One of Laravel Passport's mostly used authentication methods is the Password Grant Tokens grant type. It is a stateless way to get access tokens and refresh tokens from the OAuth Server.

Take a look at contributing.md if you want to contribute to this project.

Installation

Via Composer

Setting Up

  1. Run php artisan migrate to create the Passport related tables.

  2. Use Passport's Laravel\Passport\HasApiTokens on User model.

  3. Add these variables to .env file if you want to override the default values.
Variable Name Default Value
PASSPORT_ACCESS_TOKEN_EXPIRES_IN 15 days
PASSPORT_REFRESH_TOKEN_EXPIRES_IN 30 days
PASSPORT_PERSONAL_ACCESS_TOKEN_EXPIRES_IN 6 days
PASSPORT_HASH_CLIENT_SECRETS false

Usage

Passport PGT Server

The package provides a service called helper functions:

  1. passportPgtServer()
  2. passport_pgt_server()

Here's the list of its available methods.

Method Name Return Type Description
setPassportAsApiDriver void adds api authentication guard with passport as driver
setPassportEncryptionKeys void used for overriding Passport encryption keys
hashClientSecrets bool decides whether to hash or not client's secrets
getTokensExpiresIn Illuminate\Support\Carbon gets the Carbon datetime for access token expiration
getRefreshTokensExpiresIn Illuminate\Support\Carbon gets the Carbon datetime for refresh token expiration
getPersonalAccessTokensExpiresIn Illuminate\Support\Carbon gets the Carbon datetime for personal access token expiration
getTokenModel string gets the model class name
getTokenBuilder Illuminate\Database\Eloquent\Builder gets the model builder instance
getRefreshTokenModel string gets the model class name
getRefreshTokenBuilder Illuminate\Database\Eloquent\Builder gets the model builder instance
getPersonalAccessTokenModel string gets the model class name
getPersonalAccessTokenBuilder Illuminate\Database\Eloquent\Builder gets the model builder instance
getClientModel string gets the model class name
getClientBuilder Illuminate\Database\Eloquent\Builder gets the model builder instance

Routes

By default, laravel/passport adds authentication related routes. This package adds two new routes: /api/oauth/logout and /api/oauth/me.

Here's the list of routes that this package provides.

Method Route Description
POST /oauth/token Added by laravel/passport. This route generates the tokens.
GET /api/oauth/register This route is where we register a new user.
POST /api/oauth/logout This route revokes the current access token with refresh token.
GET /api/oauth/me This route returns the access token's user information.

Note: If you wish to override the logout or get self logic, feel free to do so by updating the published passport-pgt-server config file.

Change log

Please see the changelog for more information on what has changed recently.

Testing

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.


All versions of passport-pgt-server with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ~8|~9|~10
laravel/passport Version ^10.4|^11.5
luchavez/passport-pgt-client Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package luchavez/passport-pgt-server contains the following files

Loading the files please wait ....