Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected void configure(final HttpSecurity http) throws Exception {
- http
- .csrf().disable()
- .cors().and()
- .authorizeRequests()
- .antMatchers("/api/someEndpoint/**")
- .hasRole(ADMIN_ROLE).and().formLogin()
- .loginPage("/login").and().logout();
- }
- @Override
- protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
- auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder);
- }
- login(loginDetails:Object) {
- console.log(loginDetails)
- const headers = new Headers({ 'Content-Type': 'application/json' });
- const options = new RequestOptions({ headers: headers });
- const body = JSON.stringify(loginDetails);
- console.log(headers);
- console.log(body);
- return this.http.post(this.loginUrl, body, options)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement