Auth0 Home Blog Docs

Build and Secure a CRUD Application with Laravel 6

Learn how to build and secure a travel manager CRUD application with the new Laravel 6.0 update and handle authentication with Auth0.

Read on :hammer_and_wrench:

Brought to you by @holly :woman_technologist:t2:

1 Like

Please let us know if you have any questions on this subject!

This was an awesome article! Clear, practical and well written.

I look forward to a follow up, where implementing permissions from auth0 is covered :grin:

2 Likes

Thanks a lot @eeerlend! Passsing feedback back to @holly!

1 Like

Hello everyone the application is amazing , just for some reason for me auth0 login doesnt work even if i put the correct URL everytime give me the same error Callback URL mismatch. Can I ask for some help ?

Hey there Donco!

Can you share with us either the responsible code snippet or screenshot of the allowed callback urls field in your dashboard thanks!

Hello, thanks for your response here is a picture of my dashboard

i add I replace 127.0.0.1 with localhost and it works but now im facing another problem:

Thanks a lot for that! @holly could you look at that once you have some time?

Hi Donco! I’m glad you got the first part figured out!

There are unfortunately a lot of things that can cause that Invalid State error. Josh summarizes what could be causing it in his response here:

To help narrow it down, can you tell me when this occurred? Was it after signing in and being redirected back to the app? Did you have multiple tabs open? Does it still occur if you logout (clear session data)?

Let me know if you can reproduce it and when it occurs. In the meantime, here are some resources that have helped others with the same issue:



Hello Holly thank you for your reply , unfortunately i cannot find any solution in those treads .Any help or tutorial can be appreciated .Thank you very much indeed

Its happen after i login but what i did is when i change manually the link and change “state” to “webauth_state” i can login adn everything is ok. Can you pls tell me what i need to do excatly. Many thanks

If you receive a “callback url mismatch” error with above’s configuration, make sure that your environment configuration (.env file or similar) value for APP_URL contains the given port. The default configuration by laravel ist just
APP_URL=http://localhost
but must be something like
APP_URL=http://localhost:8000
to work with above’s settings.

2 Likes

Are there any considerations for this tutorial if we are using VALET to serve the projects? Thanks.

Thanks @valentin.sauer for providing that info. @neurosis I’m sure @holly will address that question soon!

Thanks for your respond Valentin , i check my env file and i have exactly the same link with the port as well but again i have the same error

Only if I add manually webauth_state Im able to login.

Hey sorry I missed this! So I tested this with the the tutorial codebase that I already had locally and I couldn’t replicate it. Just to be sure, I cloned the repo so I could test from scratch and I actually did get the invalid state issue then!

Here’s what I did to get rid of it:

  1. Close the old homestead.test tab I had open
  2. vagrant halt for the newly cloned repo
  3. vagrant up
  4. Open dev tools > Applications > Clear Storage > Click “Clear site data”
  5. Refresh and sign in again

After doing this, it worked for me with just “state”. Can you try to replicate this and let me know if it works? It appears to be a browser issue with multiple tabs or conflicting session data.

1 Like

Thanks a lot for digging into that @holly!

Hi Holly thank you for your reply. Unfortunately for me doesn’t work and also when i try to share the link with ngrok and login from my phone im not able to login after authorization giving me a blanl white page.