tymondesigns / jwt-auth

🔐 JSON Web Token Authentication for Laravel & Lumen
https://jwt-auth.com
MIT License
11.28k stars 1.55k forks source link

how can I decode the jwt-auth? #1305

Open andycc77 opened 7 years ago

andycc77 commented 7 years ago

hey brother how to use u r jwt-auth can i decode it teach me plz

marulitua commented 7 years ago

If use jwt.auth middleware and correctly passed the token you can decode it with app('auth')->payload() and you'll get

Payload {#137 ▼
  -claims: Collection {#177 ▼
    #items: array:7 [▼
      "iss" => Issuer {#173 ▶}
      "iat" => IssuedAt {#134 ▶}
      "exp" => Expiration {#125 ▶}
      "nbf" => NotBefore {#175 ▶}
      "jti" => JwtId {#163 ▶}
      "sub" => Subject {#176 ▶}
      0 => Custom {#174 ▶}
    ]
  }
} 

So yes, you can decode it.