Search code examples
spring-bootspring-securitystormpath

Stormpath - How to do a login by code


I'm learning Stormpath with Spring-Boot and Spring-Security. I want to do a Service to do the login of users, and I saw only examples by the login view of Stormpath's web, with the inputs of the email and password, but I want to do that by code, using the classes of Stormpath. Is there any way to do that?

Thanks.


Solution

  • You can look at the code in Stormpath's LoginController and see how to do it manually. However, I'm not sure why you'd want to do that when Stormpath provides the integration so you hardly need to write any code. With our next release (and Spring Boot 1.5), you won't need any code to integrate it with Spring Boot and Spring Security. Just drop in the dependency and it works!