BAEL-124 - Minor refactors

This commit is contained in:
Slavisa Baeldung 2016-08-11 16:41:51 +02:00
parent 679dfa1942
commit b6ef8de700
11 changed files with 1 additions and 180 deletions

View File

@ -15,29 +15,8 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException;
@SpringBootApplication
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class X509AuthenticationServer extends WebSecurityConfigurerAdapter {
public static void main(String[] args) {
SpringApplication.run(X509AuthenticationServer.class, args);
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().anyRequest().authenticated()
.and()
.x509().subjectPrincipalRegex("CN=(.*?)(?:,|$)").userDetailsService(userDetailsService());
}
@Bean
public UserDetailsService userDetailsService() {
return new UserDetailsService() {
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
if (username.equals("cid")) {
return new User(username, "", AuthorityUtils.commaSeparatedStringToAuthorityList("ROLE_USER"));
}
throw new UsernameNotFoundException("User not found!");
}
};
}
}

View File

@ -1,4 +1,4 @@
server.ssl.key-store=classpath:keystore.jks
server.ssl.key-store=../keystore/keystore.jks
server.ssl.key-store-password=changeit
server.ssl.key-alias=localhost
server.ssl.key-password=changeit

View File

@ -1,28 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIFlTCCA32gAwIBAgIEAMem9DANBgkqhkiG9w0BAQ0FADB0MQswCQYDVQQGEwJDQzESMBAGA1UE
CBMJU29tZVN0YXRlMREwDwYDVQQHEwhTb21lQ2l0eTERMA8GA1UEChMIQmFlbGR1bmcxFTATBgNV
BAsTDGJhZWxkdW5nLmNvbTEUMBIGA1UEAxMLQmFlbGR1bmcgQ0EwHhcNMTYwODExMDUwNzE1WhcN
MjYwODA5MDUwNzE1WjB0MQswCQYDVQQGEwJDQzESMBAGA1UECBMJU29tZVN0YXRlMREwDwYDVQQH
EwhTb21lQ2l0eTERMA8GA1UEChMIQmFlbGR1bmcxFTATBgNVBAsTDGJhZWxkdW5nLmNvbTEUMBIG
A1U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View File

@ -1,24 +0,0 @@
PASSWORD=changeit
KEYSTORE=keystore.jks
HOSTNAME=localhost
CLIENTNAME=cid
# CN = Common Name
# OU = Organization Unit
# O = Organization Name
# L = Locality Name
# ST = State Name
# C = Country (2-letter Country Code)
# E = Email
DNAME_CA='CN=Baeldung CA,OU=baeldung.com,O=Baeldung,L=SomeCity,ST=SomeState,C=CC'
# For server certificates, the Common Name (CN) must be the hostname
DNAME_HOST='CN=$(HOSTNAME),OU=baeldung.com,O=Baeldung,L=SomeCity,ST=SomeState,C=CC'
DNAME_CLIENT='CN=$(CLIENTNAME),OU=baeldung.com,O=Baeldung,L=SomeCity,ST=SomeState,C=CC'
TRUSTSTORE=truststore.jks
# Generate a certificate authority (CA)
keytool -genkey -alias ca -ext BC=ca:true \
-keyalg RSA -keysize 4096 -sigalg SHA512withRSA -keypass $(PASSWORD) \
-validity 3650 -dname $(DNAME_CA) \
-keystore $(KEYSTORE) -storepass $(PASSWORD)

View File

@ -1,28 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIFpjCCA46gAwIBAgIEODZ8OjANBgkqhkiG9w0BAQ0FADB0MQswCQYDVQQGEwJDQzESMBAGA1UE
CBMJU29tZVN0YXRlMREwDwYDVQQHEwhTb21lQ2l0eTERMA8GA1UEChMIQmFlbGR1bmcxFTATBgNV
BAsTDGJhZWxkdW5nLmNvbTEUMBIGA1UEAxMLQmFlbGR1bmcgQ0EwHhcNMTYwODExMDUwODEyWhcN
MjYwODA5MDUwODEyWjByMQswCQYDVQQGEwJDQzESMBAGA1UECBMJU29tZVN0YXRlMREwDwYDVQQH
EwhTb21lQ2l0eTERMA8GA1UEChMIQmFlbGR1bmcxFTATBgNVBAsTDGJhZWxkdW5nLmNvbTESMBAG
A1UEAxMJbG9jYWxob3N0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAhDGBomd3CmNf
ahbnsaYaA1IQbXsGd+heb1e8c+diWggSg7r6xH90o43or+nQPk1g9VB8C/o79Ldhe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