Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- id_user | password | nombre | email
- -------------------------------------------------
- 1 | $2y$10$pDweWy | pedro | pedro@mail.com
- 2 | $2y$10$l43VL1 | juan | juan@mail.com
- 3 | $2y$10$TJdiWI | diego | diego@mail.com
- id_user | password | nombre | email
- -------------------------------------------------------------------
- 1 | FPbDMzL3hoUkM4ME9aZW56eWF1abcd | pedro | pedro@mail.com
- 2 | ptTXJCTndPOE9ucElQa2ZtSXg2Ly5o | juan | juan@mail.com
- 3 | BkQjN1QkdINWFsS3hQUHA2QTU2QmVr | diego | diego@mail.com
- <?php
- $firma=getenv('TOKEN_SECRET');
- $info_relevante=[
- 'id_user'=>1,
- 'nombre'=>'pedro',
- 'email'=> 'pedro@mail.com',
- 'expiracion'=>1531484696103
- ];
- $parte_central = base64_encode(json_encode($info_relevante));
- eyJpZF91c2VyIjoxLCJub21icmUiOiJwZWRybyIsImVtYWlsIjoicGVkcm9AbWFpbC5jb20iLCJleHBpcmFjaW9uIjoxNTMxNDg0Njk2MTAzfQ==
- $token = funcion_firma_jwt($parte_central, $firma);
- // forma del token: qwertyx.<parte_central>.asdfg_zxcvb
Add Comment
Please, Sign In to add comment