Laravel SDK - Get access token for API

In that case, you’re probably looking for a machine-to-machine (M2M) flow. As long as you can keep the credentials safe for the Laravel app, then you can get a token for your Java API that way. This is the same way you would authenticate for the Management API.

The main thing to note about this is that your Laravel app needs to have Advanced > Grant Types > Client Credentials turned on in Auth0 and the Application authorized for that API. After that, just run the M2M flow and you’ll have what you need.

Since you mentioned login, I assume that the Laravel app would be acting on behalf of a user so the control over what that user can do as it pertains to the Java API would need to happen in Laravel. You can also restrict what scopes the Laravel app can get so the Java API is careful about what it hands back.

Let me know if you have any questions about this!