This commit is contained in:
kimscott
2019-09-02 11:17:18 +09:00
commit 9db6c41b37
10 changed files with 356 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
//package com.example.template;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.core.io.ClassPathResource;
//import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity;
//import org.springframework.security.config.web.server.ServerHttpSecurity;
//import org.springframework.security.oauth2.provider.token.store.KeyStoreKeyFactory;
//import org.springframework.security.web.server.SecurityWebFilterChain;
//
//import java.security.KeyPair;
//
//@Configuration
//@EnableWebFluxSecurity
//public class ResourceServerConfiguration {
//
// @Bean
// SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) throws Exception {
//
// http
// .cors().and()
// .csrf().disable()
// .authorizeExchange()
// .pathMatchers("/oauth/**","/login/**","/.well-known/jwks.json").permitAll()
// .anyExchange().authenticated()
// .and()
// .oauth2ResourceServer()
// .jwt()
// ;
//
// return http.build();
// }
//
// @Bean
// public KeyPair makeKeyPair(){
// KeyPair keyPair = new KeyStoreKeyFactory(
// new ClassPathResource("server.jks"), "qweqwe".toCharArray())
// .getKeyPair("uengine", "qweqwe".toCharArray());
// return keyPair;
// }
//
//
//}