Download the PHP package iqbalatma/laravel-jwt-authentication without Composer

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

Laravel JWT Authentication

This is authentication for Laravel with JWT Based. Inspired by tymondesigns/jwt-auth and PHP-Open-Source-Saver/jwt-auth. This site was built using package from firebase/php-jwt for encode and decode JWT.


Next Feature

This is the lists of next feature

How To Install

This package using syntax and feature that only available on php version at least 8.0


Publishing Asset

You can publish asset for customization using this command


Generate JWT Credentials

This credential is used for sign jwt token and make sure the token is valid

or using pairs of public and secret key


Configuration config/auth.php


Configuration config/jwt.php

Jwt signin using public and private key is first priority, so if you define private and public key, jwt will be signing using this key pairs. But if you do not define private and public key, jwt will use secret key for signing. If two type key does not exists, it will throw an error.

[!NOTE] Here is available algorithm if you're using secret key

  • HS512
  • HS256
  • HS384
  • HS224

[!NOTE] Here is available algorithm if you're using pairs of public and private key

  • RS512
  • RS256
  • RS384
  • ES384
  • ES256
  • ES256K

Implement JWTSubject

You need to implement Iqbalatma\LaravelJwtAuthentication\Interfaces\JWTSubject on User model. If you would like to add another additional data on jwt claim, you can return array on getJWTCustomClaims


How to use middleware ?

When you are doing authentication, you will receive 2 types token, access and refresh. Access token use to get protected resource, for example get data product, add new data user, etc. Access token has shorter ttl, so when access token expired, you can regenerate new token with refresh token. Endpoint that do refresh token must be protected by middleware type refresh. You can see the example on how to implement this middleware bellow


How to use ?

Here is some available method for authentication

Authenticate User

This feature used for validate credentials from user request and return back access_token and refresh_token

Logout User

This feature used for invalidate and blacklist current authorization token

Refresh Token

This feature used for invalidate access_token and refresh_token and invoke new access_token and refresh_token

Login By System

This method use for login existing user via authenticable instance

Get Token

After login or attempt method triggered and successfully, you can get token access and refresh via guard instance

Issued Token Service

This is a service related to issued token, access or refresh token. You can get list of issued token with their user-agent or revoke the token


All versions of laravel-jwt-authentication with dependencies

PHP Build Version
Package Version
Requires firebase/php-jwt Version ^6.9
archtechx/enums Version ^1.0.0
ext-openssl Version *
php Version ^8.2
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 iqbalatma/laravel-jwt-authentication contains the following files

Loading the files please wait ....