Skip to content
Snippets Groups Projects
Commit 453a053d authored by Julian Horner's avatar Julian Horner
Browse files

Minor improvements

parent 605a3e88
No related branches found
No related tags found
No related merge requests found
...@@ -57,8 +57,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { ...@@ -57,8 +57,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
// Permit only users with ADMIN role. // Permit only users with ADMIN role.
.antMatchers("/securedPage/**").hasRole("ADMIN") .antMatchers("/securedPage/**").hasRole("ADMIN")
// Permit auth and login path for sending credentials. // Permit auth and login path for sending credentials.
.antMatchers("/auth/**").permitAll() .antMatchers("/auth/**", "/login").permitAll().and()
.antMatchers("/login").permitAll().and()
// Configures where to forward if authentication is required. // Configures where to forward if authentication is required.
.formLogin().loginPage("/login"); .formLogin().loginPage("/login");
} }
......
...@@ -56,7 +56,7 @@ public class JWTAuthenticationFilter extends OncePerRequestFilter { ...@@ -56,7 +56,7 @@ public class JWTAuthenticationFilter extends OncePerRequestFilter {
FilterChain chain) throws ServletException, IOException { FilterChain chain) throws ServletException, IOException {
// Gets the access_token parameter. // Gets the access_token parameter.
String bearerToken = request.getParameter("access_token"); String bearerToken = request.getParameter("access_token");
// Validate the header and check the prefix. // Validate the token and check the prefix.
if (bearerToken == null || !bearerToken.startsWith(jwtConfiguration.getPrefix())) { if (bearerToken == null || !bearerToken.startsWith(jwtConfiguration.getPrefix())) {
// If there's no token the user isn't authenticated and we execute the next filter. // If there's no token the user isn't authenticated and we execute the next filter.
chain.doFilter(request, response); // If not valid, go to the next filter. chain.doFilter(request, response); // If not valid, go to the next filter.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment