PHP 클래스 Irazasyed\JwtAuthGuard\JwtAuthGuard

상속: implements Illuminate\Contracts\Auth\Guard, use trait Illuminate\Auth\GuardHelpers
파일 보기 프로젝트 열기: irazasyed/jwt-auth-guard

보호된 프로퍼티들

프로퍼티 타입 설명
$jwt Tymon\JWTAuth\JWT The JWT instance.
$lastAttempted Illuminate\Contracts\Auth\Authenticatable The user we last attempted to retrieve.
$request Illuminate\Http\Request The request instance.

공개 메소드들

메소드 설명
__call ( string $method, array $parameters ) : mixed Magically call the JWT instance.
__construct ( Tymon\JWTAuth\JWT $jwt, Illuminate\Contracts\Auth\UserProvider $provider, Illuminate\Http\Request $request ) Create a new authentication guard.
attempt ( array $credentials = [], boolean $login = true ) : mixed Attempt to authenticate the user using the given credentials and return the token.
generateTokenById ( mixed $id ) : string | null Generate new token by ID.
getLastAttempted ( ) : Illuminate\Contracts\Auth\Authenticatable Get the last user we attempted to authenticate.
getPayload ( ) : Tymon\JWTAuth\Payload Get the raw Payload instance.
getProvider ( ) : Illuminate\Contracts\Auth\UserProvider Get the user provider used by the guard.
getToken ( ) : false | Token Get the token.
getUser ( ) : Illuminate\Contracts\Auth\Authenticatable | null Return the currently cached user.
invalidate ( boolean $forceForever = false ) : boolean Invalidate current token (add it to the blacklist).
login ( Tymon\JWTAuth\Contracts\JWTSubject $user ) : string Create a token for a user.
logout ( boolean $forceForever = true ) : boolean Logout the user.
once ( array $credentials = [] ) : boolean Log a user into the application without sessions or cookies.
onceUsingId ( mixed $id ) : boolean Log the given user ID into the application without sessions or cookies.
refresh ( ) : string Refresh current expired token.
setProvider ( Illuminate\Contracts\Auth\UserProvider $provider ) Set the user provider used by the guard.
setRequest ( Illuminate\Http\Request $request ) Set the current request instance.
setToken ( Token | string $token ) : JwtGuard Set the token.
user ( ) : Illuminate\Contracts\Auth\Authenticatable | null Get the currently authenticated user.
validate ( array $credentials = [] ) : boolean Validate a user's credentials.

보호된 메소드들

메소드 설명
hasValidCredentials ( mixed $user, array $credentials ) : boolean Determine if the user matches the credentials.
requireToken ( ) : Tymon\JWTAuth\JWT Ensure that a token is available in the request.

메소드 상세

__call() 공개 메소드

Magically call the JWT instance.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
리턴 mixed

__construct() 공개 메소드

Create a new authentication guard.
public __construct ( Tymon\JWTAuth\JWT $jwt, Illuminate\Contracts\Auth\UserProvider $provider, Illuminate\Http\Request $request )
$jwt Tymon\JWTAuth\JWT
$provider Illuminate\Contracts\Auth\UserProvider
$request Illuminate\Http\Request

attempt() 공개 메소드

Attempt to authenticate the user using the given credentials and return the token.
public attempt ( array $credentials = [], boolean $login = true ) : mixed
$credentials array
$login boolean
리턴 mixed

generateTokenById() 공개 메소드

Generate new token by ID.
public generateTokenById ( mixed $id ) : string | null
$id mixed
리턴 string | null

getLastAttempted() 공개 메소드

Get the last user we attempted to authenticate.
public getLastAttempted ( ) : Illuminate\Contracts\Auth\Authenticatable
리턴 Illuminate\Contracts\Auth\Authenticatable

getPayload() 공개 메소드

Get the raw Payload instance.
public getPayload ( ) : Tymon\JWTAuth\Payload
리턴 Tymon\JWTAuth\Payload

getProvider() 공개 메소드

Get the user provider used by the guard.
public getProvider ( ) : Illuminate\Contracts\Auth\UserProvider
리턴 Illuminate\Contracts\Auth\UserProvider

getToken() 공개 메소드

Get the token.
public getToken ( ) : false | Token
리턴 false | Token

getUser() 공개 메소드

Return the currently cached user.
public getUser ( ) : Illuminate\Contracts\Auth\Authenticatable | null
리턴 Illuminate\Contracts\Auth\Authenticatable | null

hasValidCredentials() 보호된 메소드

Determine if the user matches the credentials.
protected hasValidCredentials ( mixed $user, array $credentials ) : boolean
$user mixed
$credentials array
리턴 boolean

invalidate() 공개 메소드

Invalidate current token (add it to the blacklist).
public invalidate ( boolean $forceForever = false ) : boolean
$forceForever boolean
리턴 boolean

login() 공개 메소드

Create a token for a user.
public login ( Tymon\JWTAuth\Contracts\JWTSubject $user ) : string
$user Tymon\JWTAuth\Contracts\JWTSubject
리턴 string

logout() 공개 메소드

Logout the user.
public logout ( boolean $forceForever = true ) : boolean
$forceForever boolean
리턴 boolean

once() 공개 메소드

Log a user into the application without sessions or cookies.
public once ( array $credentials = [] ) : boolean
$credentials array
리턴 boolean

onceUsingId() 공개 메소드

Log the given user ID into the application without sessions or cookies.
public onceUsingId ( mixed $id ) : boolean
$id mixed
리턴 boolean

refresh() 공개 메소드

Refresh current expired token.
public refresh ( ) : string
리턴 string

requireToken() 보호된 메소드

Ensure that a token is available in the request.
protected requireToken ( ) : Tymon\JWTAuth\JWT
리턴 Tymon\JWTAuth\JWT

setProvider() 공개 메소드

Set the user provider used by the guard.
public setProvider ( Illuminate\Contracts\Auth\UserProvider $provider )
$provider Illuminate\Contracts\Auth\UserProvider

setRequest() 공개 메소드

Set the current request instance.
public setRequest ( Illuminate\Http\Request $request )
$request Illuminate\Http\Request

setToken() 공개 메소드

Set the token.
public setToken ( Token | string $token ) : JwtGuard
$token Token | string
리턴 JwtGuard

user() 공개 메소드

Get the currently authenticated user.
public user ( ) : Illuminate\Contracts\Auth\Authenticatable | null
리턴 Illuminate\Contracts\Auth\Authenticatable | null

validate() 공개 메소드

Validate a user's credentials.
public validate ( array $credentials = [] ) : boolean
$credentials array
리턴 boolean

프로퍼티 상세

$jwt 보호되어 있는 프로퍼티

The JWT instance.
protected JWT,Tymon\JWTAuth $jwt
리턴 Tymon\JWTAuth\JWT

$lastAttempted 보호되어 있는 프로퍼티

The user we last attempted to retrieve.
protected Authenticatable,Illuminate\Contracts\Auth $lastAttempted
리턴 Illuminate\Contracts\Auth\Authenticatable

$request 보호되어 있는 프로퍼티

The request instance.
protected Request,Illuminate\Http $request
리턴 Illuminate\Http\Request