Guest User

Untitled

a guest
Jul 13th, 2018
1,921
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. id_user | password | nombre | email
  2. -------------------------------------------------
  3. 1 | $2y$10$pDweWy | pedro | pedro@mail.com
  4. 2 | $2y$10$l43VL1 | juan | juan@mail.com
  5. 3 | $2y$10$TJdiWI | diego | diego@mail.com
  6.  
  7. id_user | password | nombre | email
  8. -------------------------------------------------------------------
  9. 1 | FPbDMzL3hoUkM4ME9aZW56eWF1abcd | pedro | pedro@mail.com
  10. 2 | ptTXJCTndPOE9ucElQa2ZtSXg2Ly5o | juan | juan@mail.com
  11. 3 | BkQjN1QkdINWFsS3hQUHA2QTU2QmVr | diego | diego@mail.com
  12.  
  13. <?php
  14.  
  15. $firma=getenv('TOKEN_SECRET');
  16.  
  17. $info_relevante=[
  18. 'id_user'=>1,
  19. 'nombre'=>'pedro',
  20. 'email'=> 'pedro@mail.com',
  21. 'expiracion'=>1531484696103
  22. ];
  23.  
  24. $parte_central = base64_encode(json_encode($info_relevante));
  25.  
  26. eyJpZF91c2VyIjoxLCJub21icmUiOiJwZWRybyIsImVtYWlsIjoicGVkcm9AbWFpbC5jb20iLCJleHBpcmFjaW9uIjoxNTMxNDg0Njk2MTAzfQ==
  27.  
  28. $token = funcion_firma_jwt($parte_central, $firma);
  29. // forma del token: qwertyx.<parte_central>.asdfg_zxcvb
Add Comment
Please, Sign In to add comment