Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. @Override
  2. protected void configure(final HttpSecurity http) throws Exception {
  3. http
  4. .csrf().disable()
  5. .cors().and()
  6. .authorizeRequests()
  7. .antMatchers("/api/someEndpoint/**")
  8. .hasRole(ADMIN_ROLE).and().formLogin()
  9. .loginPage("/login").and().logout();
  10. }
  11.  
  12.  
  13. @Override
  14. protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
  15. auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder);
  16. }
  17.  
  18. login(loginDetails:Object) {
  19. console.log(loginDetails)
  20. const headers = new Headers({ 'Content-Type': 'application/json' });
  21. const options = new RequestOptions({ headers: headers });
  22. const body = JSON.stringify(loginDetails);
  23. console.log(headers);
  24. console.log(body);
  25. return this.http.post(this.loginUrl, body, options)
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement