Login Spring Boot + Spring Secutrity + Angular

Asked

Viewed 1,050 times

1

What structure is used for the Spring Boot, Spring Security and Angular Js combination to manage login and the Spring application will be in Rest.

Will the login controller be in the Rest format as well or will it be in the Modelandview structure? Do you store user data in $rootScope or another variable? If this is the format you can provide an example because I created next to this structure but I’m a little lost, when sending to the login page presents dependency injection problems, I try to log in and can’t see if returned sucess or error. For the Spring I used

auth.
    jdbcAuthentication()
        .usersByUsernameQuery(usersQuery)
        .authoritiesByUsernameQuery(rolesQuery)
        .dataSource(dataSource)
        .passwordEncoder(bCryptPasswordEncoder)
        ;

Using something other than Spring Security?

Note: Spring is blocking as configured I just need to know how they do this structure. I thank you already.

1 answer

2


If you choose the REST style, you can use authentication via Json Web Tokens (Jwts). Jwts have several advantages over the traditional authentication model (via session). Beneath the surface, an authentication implementation via JWT also uses Spring Security, and is VERY simple to implement. See in this link how to implement authentication with JWT, its positives and negatives: http://andreybleme.com/2017-04-01/autenticacao-com-jwt-no-spring-boot/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.