Commit 61dfcefd authored by Noel Alonso's avatar Noel Alonso
Browse files

Añade métodos permitidos

parent d3796de8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9,6 +9,6 @@ public class CorsConfiguration implements WebMvcConfigurer {

	@Override
	public void addCorsMappings(CorsRegistry registry) {
		registry.addMapping("/**");
		registry.addMapping("/**").allowedMethods("GET", "PUT", "POST", "DELETE");
	}
}
+1 −3
Original line number Diff line number Diff line
@@ -66,8 +66,7 @@ public class Oauth2SecurityConfiguration {
		public void configure(HttpSecurity http) throws Exception {
			// @formatter:off
			
			http.cors().disable().anonymous().and().authorizeRequests().antMatchers("/user/actuator/**").permitAll()
					.antMatchers(HttpMethod.OPTIONS, "/**").permitAll()
			http.cors().and().anonymous().and().authorizeRequests().antMatchers("/user/actuator/**").permitAll()
					.antMatchers(HttpMethod.GET, "/user/profile/").permitAll()
					.antMatchers(HttpMethod.GET, "/user/modules/openmodules/").permitAll()
					.antMatchers(HttpMethod.POST, "/user/register/**/").permitAll()
@@ -80,5 +79,4 @@ public class Oauth2SecurityConfiguration {
					"#oauth2.hasScope('read') or #oauth2.hasScope('write') and hasAnyRole('ROLE_ADMINISTRATOR', 'ROLE_OAG', 'ROLE_COLLABORATOR', 'ROLE_USER')");
		}
	}

}