GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • [email protected]

This view

  • Original page
  • New address

GeezerVison is showing code4mk.org — kauth

kauth

kauth

kauth

kauth is JWT API Authentication ( jwt-auth ) for laravel

Installation

you can install kauth package by command

composer require code4mk/kauth

Setup

1) Vendor publish.

php artisan vendor:publish --provider="Kauth\KauthServiceProvider" --tag=config
php artisan vendor:publish --provider="Kauth\KauthServiceProvider" --tag=migations

2) Config setup

  • config\kauth.php

  • set token_header_name that you can use with guzzle or axios header
  • default token_header_name name is tokon

Usage

Kauth::attempt() functions

  • guard(‘name’)
    // guard name will be user table name
    Kauth::guard("users")
    
  • socialite()->attempt()
    // laravel socialite system
    // credential will be only email
    Kauth::guard("users")->socialite()
          ->attempt(["email"=>"[email protected]"]);
    
  • normal attempt()
    // your all desired credentials
    // password credentail need
    Kauth::guard("users")
    ->attempt(["email"=>"[email protected]","password"=>1234])
    

~ attempt() return a jwt token which you pass with request header (ex:axios header)

attempt special

  • username credential will be optional as (id email username) . (ex: facebook username)
  • usernames describe which columns you want to match for username
attempt(["usernames"=>["id","email","name"],"username"=>"request query for username","password=>123456"]);

Kauth::check()

Kauth::check();

Kauth::id()

Kauth::id();

Kauth::refreshToken()

Kauth::refreshToken()

Kauth::logout()

Kauth::logout();

Kauth::logoutOtherDevices()

Kauth::logoutOtherDevices();

<p align="center" ></p>

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.