I have referred https://www.sitepoint.com/php-authorization-jwt-json-web-tokens/
This topic is new to me. I can understand this article. But I can’t implement it. Could you please share file structure and step by step implementation code.
I have referred https://www.sitepoint.com/php-authorization-jwt-json-web-tokens/
This topic is new to me. I can understand this article. But I can’t implement it. Could you please share file structure and step by step implementation code.
what have you tried by yourself?
how far have you come?
what errors did you encounter?
did you read some other tutorial?
There’s a couple of links to sample code in that article, are they not sufficient to get you started?
I just tried with git source. I have checked with mySQL credentials, but it doesn’t work.
I’m not getting any other tutorial for JWT + PHP +MySQL rest api. If you know that, please share the link.
I need some more detailed steps for implementation.
The article does assume some prerequisite knowledge of JSON and using the composer package manager.
Am I correct in thinking it’s not the code examples you’re having trouble with but getting the packages installed?
Or maybe there have been breaking changes because of dependency version changes since that article was published? No error messages and a clean error log?
the system is pretty simple, just have a look at
you can merely use it as PHP code
here is another step-by-step tutorial
REST is some other thing.
There is no issue with installed packages.
I already tried this.
I request the community to help me to implement the below logic.
After successful login, user has jwt, Then he needs to send the corresponding jwt with each restapi route to fetch the data. When user logout, jwt will expire.
Is it possible to implement?
If it is, please provide me the detailed steps with code.
JWT would be the access token as well.
I don’t see what you have tried so far from what you have learned from the linked tutorials. Show code.
I already tried http://www.phpbuilder.com/articles/application-architecture/security/using-a-json-web-token-in-php.html and able to get the output too.
When I tried with git source of “PHP Authorization with JWT (JSON Web Tokens)” (https://github.com/tecnom1k3/sp-simple-jwt), index.html is displayed as such in browser. I have created user table and give MySQL credentials to git source. It doesn’t accept user credentials and token is not generated. I don’t know where is the problem.
Am I proceed in wrong way? If it is, please guide me.
Please find the attachment.
And still the request remains: show code - the code you build yourself, the code that is located around where the error remains while you go step-by-step through your code. we can’t guide you anywhere as long as you do not provide a point to start from. If the functions from phpbuilder are working, stay with them and provide the data from your database to the token. Did you understand what the token does and how it works? REST API, JWT and SQL Database are thee different topics, don’t start mixing them up. Here’s another example
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.