Guys because I want you to get started easier with php artisan serve, instead of sending the request with guzzle, I did it the "laravel way" at the end.
cannot thank you enough for making this. I was beating my head against the wall trying to get through the laravel documentation and you helped me out 1000000 million. Thank you!
Hey Bro! Thank you for this. I fixed my OAuth2 configuration on SPA hosted on Heroku. You deserve more subscriber and thumbs up because not everyone are willing to share their knowledge for free. More power!
Yes it is, but it's far more complex and you have to make the API really really well because third party will have to integrate with it. Example: Keycloak
Thanks! We have a video on roles and we can use the store too, someone else asked not to use the store,but we can make a video to show you, how it would be. When you get to the latest videos, tell me if you still want that.
Hello peter, I get an error called "invalid_grant" with 400 response (bad request). It said that provided authorization grant or refresh token was invalid, expired, revoked, didn't match the redirection URI, or was issued to another client. What should i do? Thanks
I think that you regenerated your DB clients while being logged in on the application? Did you finish the video? When do you get the error? I need some more context.
@@ProgrammingwithPeter thanks for your fast respond, peter. I have finished your video till 3rd episodes, it's awesome to follow the next episodes. So, the issue happens when i send correct user (in my app, i have changed default email with another username to logged in) and password via clicking login buttons. I followed your code to send token request, and when i use var_dump to see the token request content, it get same value.
@@ProgrammingwithPeter yep, i think everything i correct according to your step. As your mention, the default laravel passport auth using email and password to authenticate users, i changed email to other value for example identification number, etc. Back to the problem, is the league/oauth2 vendor problems?
So for you even with "email" is not working? I'm trying to find some resources for you to make it work with something else, but before that, I need to know if you made it work with "email" as the key of passport auth.
Hi Peter, did you plan to implement a logout feature too? Could this be a good way to log a user out? axios.delete('/oauth/personal-access-tokens/' + tokenId);
I totally left out the token deletion part because it's right on the docs as far as I remember, we can do it if needed. As for your line of code, you don't need to send the token, you already have it on bearer, you can find the user and get the token and either remove one token or all of users token(logout on all devices practically, here is more involed, but hope that you get the idea). Also, you don't get the tokenId anyway.
Can't remember what I did, but I use the make:controller command only if I want a resource one because it generates more, otherwise if I just need a simple one and have another that is pretty much the same, copy paste seems faster. On this episode tho, I might have copied the controllers that are generated by laravel for auth.
@@ProgrammingwithPeter there will be multiple type of users...but for now i want just another one. 1. admin user (who manages admin panel) 2. frontend user (visitors/customers) For frontend authentication i want another user model named customers.....there will be another login & registration form. I also want the service as token based authentication system which you have implemented in previous videos using passport
@@shawonhossain519 Well it shouldn't be too different, you just need to implement the security yourself, the auth logic can be reused you just need to add and check the roles, if the current user is not admin, give him forbidden errors. That's the idea behind it.
Hii in postman i have this error { "error": "invalid_grant", "error_description": "The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.", "hint": "", "message": "The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client." } thanks for your help
Can you check the database, maybe you didn't do the php artisan passport:install and you don't have any clients on passport? I think someone else had the same issue, unfortunately i can't check it right now, so if it's ok on sunday, give me a headsup to remember to check it out! Thanks for watching
Why did I get an error: SQLSTATE[HY000] [2002] Connection refused (SQL: select count(*) as aggregate from `users`,when I tested localhost:8080/api/register,I confirm that my database connection is normal.
It's hard to guess, it is something about your DB credentials, check .env, check if you can login with those credentials from another application or from terminal, check config/database.php and see if everything is in place, maybe you have a config cache so try a php artisan cache:clear
Hey, I will open github repositories with the projects folder on the next episode(in a few days), can't do it right now. But why do you need the source for the ep2 ? Do you have any issues ?
ohh I see the error, that "status:" it's not something that I put there, it should be removed. My editor it's saying that the second param is a status for that method, it's not actually on text, just visually there.
Hello, did you mean "interested" instead of "inspired" ? Because it's really hard to understand what you meant...The reason for why I said that, it's because it is really hard for a non native to talk correctly, explain things well, code and filming at the same time, I still didn't get used to this, but for sure I got better! Thanks for checking it out, even if it's not ok for you!