Download the PHP package lithemod/jwt without Composer

On this page you can find all versions of the php package lithemod/jwt. 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 jwt

Lithe Auth JWT

The JWT middleware for Lithe is responsible for user authentication, providing secure token generation, validation, and revocation.

1. Installing the JWT Middleware

To use the JWT middleware in Lithe, install via Composer:

2. Configuring the JWT Middleware

You can use the middleware directly in your routes. Here's how:

Configuration Example:

3. Using JWT Tokens

3.1 Generating a JWT Token

Generate a JWT token for an authenticated user. The token will contain relevant information such as user ID and role.

3.2 Validating a JWT Token

Use the JWT middleware to protect routes. The middleware will check the token validity on each request.

3.3 Revoking a Token

Revoke a token when a user logs out. This ensures the token can no longer be used.

3.4 Refreshing a Token

Implement an endpoint for token refresh, allowing users to obtain a new token without needing to log in again.

3.5 Retrieving User Data from the Token

Extract user information from the JWT for use in protected routes.

3.6 Validating a Token without Decoding

Validate a token without fully decoding it. This can be useful for quickly checking the authenticity of a token.

4. Methods of the JWT Class

4.1 __construct()

Description: Initializes the JWT class with a secret key, algorithm, and expiration time.

Parameters:

4.2 __invoke()

Description: Middleware to check the JWT in a request.

Parameters:

4.3 generateToken()

Description: Generates a new JWT token for a user.

Parameters:

4.4 revokeToken()

Description: Revokes a JWT token by adding it to the revoked list.

Parameters:

4.5 isTokenRevoked()

Description: Checks if a token has been revoked.

Parameters:

4.6 refreshToken()

Description: Updates an expired JWT token by generating a new one.

Parameters:

4.7 getUserFromToken()

Description: Retrieves user data from a JWT token.

Parameters:

4.8 validateToken()

Description: Validates a JWT token without decoding it.

Parameters:

Final Considerations


All versions of jwt with dependencies

PHP Build Version
Package Version
Requires firebase/php-jwt Version ^6.10
lithemod/flow Version ^1.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 lithemod/jwt contains the following files

Loading the files please wait ...