Answer the question
In order to leave comments, you need to log in
How to properly secure an Angular 2 + Spring REST application?
Good day to all! I ran into the following problem: I'm building Front-end ( Angular 2+ TypeScript ) with Webpack. The application must be fully secured, accessing any page requires a role (ADMIN,USER ).
Webpack , on the other hand , optimizes the code with one of its plugins (
CommonsChunkPlugin ) , resulting in many small pieces: Js, one html file, and assets, as in the screenshot below
:
using Spring Security , we define access, for example like this:
.antMatchers("/home", "/")
.hasAnyRole("USER", "ADMIN")
Определим кастомную форму логирования :
.formLogin().loginPage("/login")
.usernameParameter("username").passwordParameter("password")
Answer the question
In order to leave comments, you need to log in
The right decision is to secure the backend api and not the client code
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question