Login Spring Boot + Spring Secutrity + Angular

1

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

Will the login controller be in rest format too or will it be in the ModelAndView framework? Do they save user data in $ rootScope or another variable? If this is the format can inform an example because I created next to this structure but I'm a bit lost, when I send to the login page it presents dependency injection problems, I try to log in and I can not see if it returned sucess or error. For Spring I used

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

Do you use anything other than Spring Security?

Note: Spring is barred as configured, I just need to know how to do this structure. Thanks in advance.

    
asked by anonymous 18.07.2017 / 21:40

1 answer

2

If you choose the REST style, you can use Json Web Token (JWTs) . JWTs have several advantages over the traditional authentication model (via session). Beneath the wipes, an authentication implementation via JWT also uses Spring Security, and is VERY simple to deploy. See in this link how to implement authentication with JWT, its positives and negatives: link

    
19.07.2017 / 00:20