Hey @kenprogrammer
Given that the blog post was written in 2021 and it has been back linked on some sections on the docs.
Ah, I see where the confusion lies — that blog post you’re referencing is quite old, and is meant to demonstrate how to build a Laravel application that interfaces with Auth0 without using an SDK. It was accurate for the point in time it was written, but you should disregard the contents of that post and follow the quickstart and Github guidance today. Our SDK implementation is much more straightforward. Sorry for the confusion there.
I’ll ask our docs team about getting that updated to avoid future confusion around that.
Generating SDK configuration:
Please disregard the blog post, that was for a previous version of the SDK.
The Backend API sample app provided uses Laravel Sail which when you try to run says “Docker is not running” yet it’s. It could have been better if It was just a simple Laravel App. I just want to add the SDK to an existing project.
Apologies for the confusion; I assumed you meant our Laravel backend quickstart. Our maintained sample application can be found here, as linked in our quickstart.
For integrating with an existing app, just follow our guidance on our GitHub repository: https://github.com/auth0/laravel-auth0
About the JSON configurations; since they are not version controlled what happens in production? I bet many devs prefer using environmental variables since it’s not easy to accidentally add secrets to version control.
Whether it’s a .env
file or .json
file, one way or another, a file has to be ignored from version control. The point of a quickstart is to get up and running in as little time as possible, which the CLI and JSON format is excellent for achieving. As noted though, environment variables are fully supported as well.
I switched to using Session Based Laravel project using a Regular App Now after successful login I get InvalidTokenException “The JWT string must contain two dots”. That’s when calling the callback URL. I’ve just realized this is caused by the absence of IDENTIFIER/AUDIENCE, do I really need to create an API app when am using Session based authentication with a Regular App?
Yes, this is what’s referred to as an opaque token. You’ll want to provide a identifier/audience in order to retrieve a valid access token.