List of usage examples for org.springframework.http HttpMethod OPTIONS
HttpMethod OPTIONS
To view the source code for org.springframework.http HttpMethod OPTIONS.
Click Source Link
From source file:sample.config.security.SecurityConfig.java
@Override protected void configure(HttpSecurity http) throws Exception { http.addFilterBefore(new CORSFilter(), ChannelProcessingFilter.class).csrf().disable().authorizeRequests() .antMatchers(HttpMethod.OPTIONS, "/**").permitAll()//allow CORS option calls .anyRequest().authenticated().and().logout().permitAll().and().httpBasic(); }
From source file:org.openmhealth.dsu.configuration.OAuth2ResourceServerConfiguration.java
@Override public void configure(HttpSecurity http) throws Exception { http.authorizeRequests().antMatchers(HttpMethod.OPTIONS, "/v1.0.M1/dash/**").permitAll() // Allows Dashboard to make requests .anyRequest().authenticated().and().headers().addHeaderWriter((request, response) -> { if (request.getMethod().equals("OPTIONS")) { // Allows Dashboard to make requests response.addHeader("Access-Control-Allow-Origin", "https://mdash.cs.vassar.edu:8080"); response.setHeader("Access-Control-Allow-Methods", "GET"); response.setHeader("Access-Control-Allow-Headers", "accept, authorization, cache-control"); response.setHeader("Access-Control-Allow-Credentials", "true"); }//from www . j a va 2s. c o m }); }
From source file:com.cletogadelha.WebSecurityConfiguration.java
@Override public void configure(WebSecurity web) throws Exception { web.ignoring().antMatchers(HttpMethod.OPTIONS, "/**"); }
From source file:io.github.proxyprint.kitchen.config.WebSecurityConfig.java
@Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable().authorizeRequests().antMatchers(HttpMethod.OPTIONS, "/**").permitAll() .antMatchers("/api/**").hasRole("USER").and().httpBasic(); }
From source file:blankd.acme.pet.licensing.config.security.WebSecurityConfig.java
@Override public void configure(WebSecurity w) { w.ignoring().antMatchers(HttpMethod.OPTIONS, "/**"); }
From source file:org.openbaton.nfvo.security.authentication.SecurityConfig.java
@Override protected void configure(HttpSecurity http) throws Exception { http.antMatcher("/**").httpBasic().and().authorizeRequests() .antMatchers(HttpMethod.OPTIONS, "/oauth/token", "/register").permitAll(); }
From source file:com.flipkart.poseidon.api.APIApplication.java
@Override public void handleRequest(PoseidonRequest request, PoseidonResponse response) throws ElementNotFoundException, BadRequestException, ProcessingException, InternalErrorException { HttpMethod method = request.getAttribute(RequestConstants.METHOD); boolean handled = false; if (method != null && method.equals(HttpMethod.OPTIONS)) { handled = handleOptionsRequest(request, response); }/*from w ww .j a v a2 s . co m*/ if (!handled) { // Ideally, we have to get the buildable for this request, get // API name from the buildable and use it to start a meter here. // As getting a buildable could be time consuming (say we use trie // instead of a map as in APIBuildable), we start a meter in // APILegoSet.getBuildable() and stop it here try { lego.buildResponse(request, response); } finally { Object timerContext = request.getAttribute(TIMER_CONTEXT); if (timerContext != null && timerContext instanceof Timer.Context) { ((Timer.Context) timerContext).stop(); } } } }
From source file:com.juliuskrah.multipart.security.SecurityConfig.java
@Override public void configure(WebSecurity web) throws Exception { // @formatter:off web.ignoring().antMatchers(HttpMethod.OPTIONS, "/**") // what is this? .antMatchers("/css/**").antMatchers("/js/**"); // @formatter:on }
From source file:io.syndesis.runtime.SecurityConfiguration.java
@Override @SuppressWarnings("PMD.SignatureDeclareThrowsException") protected void configure(HttpSecurity http) throws Exception { http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() .addFilter(requestHeaderAuthenticationFilter()) .addFilter(new AnonymousAuthenticationFilter("anonymous")).authorizeRequests() .antMatchers(HttpMethod.OPTIONS).permitAll().antMatchers("/api/v1/swagger.*").permitAll() .antMatchers("/api/v1/index.html").permitAll().antMatchers("/api/v1/version").permitAll() .antMatchers(HttpMethod.GET, "/api/v1/credentials/callback").permitAll().antMatchers("/api/v1/**") .hasRole("AUTHENTICATED").anyRequest().permitAll(); http.csrf().disable();/*from w w w . j a va 2 s . com*/ }
From source file:net.eusashead.hateoas.springhalbuilder.controller.CustomerOrdersControllerITCase.java
@Test public void testOptions() throws Exception { this.mockMvc/*from w w w .ja va2 s . c o m*/ .perform(request(HttpMethod.OPTIONS, "http://localhost/customer/1/orders/") .contentType(HalHttpMessageConverter.HAL_JSON).accept(HalHttpMessageConverter.HAL_JSON)) .andExpect(status().isOk()).andExpect(header().string("Allow", "GET,HEAD")).andReturn(); }