Auth0 Home Blog Docs

Spring Boot 2 Secuity with Auth0

spring-boot
spring-security
#1

I’m a new Auth0 user from a paying customer. We have a DashBoard and an application we created. We have users, and I’ve used Auth0 in Spring 5 (non Spring Boot) and this has worked.

Essentially what we did was have a login page on the UI, and sent the username/password in an HTTPS POST to the back-end, Spring 5 (non-Spring Boot). We took the username/password and made our own java.net.HTTPUrlConnection to:
https://tenant.auth0.com/oauth/token and we got back our access token without any issue.

However, we are using Spring Boot 2 and Spring Boot 2 Security. We know that Auth0 has a QuickStart for “Spring Security” and we looked into that code. The code doesn’t show anywhere where we pass in a username (email) or password. Not too mention, most if not all of the Auth0 samples in GitHub all are for Spring Boot 1.5.6 not Spring Boot 2.0.
This caused our test app to break because some of the package name to classes has changed. We worked through those issues, the app compiles and builds, and we can even get it to run … but how do we login? I’d expect pass in a username/password to test this, and that doesn’t seem to work.

So, what we need is a working example of a /login API RESTful call where we can pass the username and password to auth0 to be authenticated? We’d really like to use Spring Boot2 Security if we could rather than a standard Java solution, but if we have to do that route we will.

Any Spring Boot 2 Security examples out there that work?

Thanks!