Skip to content

Commit

Permalink
v0.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Choon-Chern Lim committed Mar 8, 2016
1 parent 3954f12 commit bc03ebc
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 18 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log


## 0.2.2 - 2016-03-08

* Fixed casing typo from `SAMLConfigBean.keyStoreResource` to `SAMLConfigBean.keystoreResource`.

## 0.2.1 - 2016-03-07

* Added `SAMLConfigBean.keystorePrivateKeyPassword` to add password for private key.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Tested against:-
<dependency>
<groupId>com.github.choonchernlim</groupId>
<artifactId>spring-security-adfs-saml2</artifactId>
<version>0.2.1</version>
<version>0.2.2</version>
</dependency>
```

Expand Down Expand Up @@ -48,8 +48,8 @@ class AppSecurityConfig extends SAMLWebSecurityConfigurerAdapter {
return new SAMLConfigBeanBuilder()
.setAdfsHostName("idp-adfs-server")
.setKeyStoreResource(new DefaultResourceLoader().getResource("classpath:keystore.jks"))
.setKeystoreAlias("alias")
.setKeystorePassword("storepass")
.setKeystoreAlias("alias")
.setKeystorePrivateKeyPassword("keypass")
.setSuccessLoginDefaultUrl("/")
.setSuccessLogoutUrl("/goodbye")
Expand Down Expand Up @@ -92,8 +92,8 @@ class AppSecurityConfig extends SAMLWebSecurityConfigurerAdapter {
|---------------------------|----------|----------------------------------------------------------------------------------------------------------|
|adfsHostName |Yes |ADFS host name without HTTPS protocol.<p>If ADFS link is `https://idp-adfs-server/adfs/ls`, the value should be `idp-adfs-server`.|
|keyStoreResource |Yes |App's keystore containing its public/private key and ADFS' certificate with public key. |
|keystoreAlias |Yes |Alias of app's public/private key pair. |
|keystorePassword |Yes |Password to access app's keystore. |
|keystoreAlias |Yes |Alias of app's public/private key pair. |
|keystorePrivateKeyPassword |Yes |Password to access app's private key. |
|successLoginDefaultUrl |Yes |Where to redirect user on successful login if no saved request is found in the session. |
|successLogoutUrl |Yes |Where to redirect user on successful logout. |
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>

<artifactId>spring-security-adfs-saml2</artifactId>
<version>0.2.1</version>
<version>0.2.2</version>
<packaging>jar</packaging>

<name>Spring Security ADFS SAML2</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public final class SAMLConfigBean {
/**
* (REQUIRED) Keystore containing app's public/private key and ADFS' certificate with public key.
*/
private final Resource keyStoreResource;
private final Resource keystoreResource;

/**
* (REQUIRED) Keystore alias.
Expand Down Expand Up @@ -77,7 +77,7 @@ public final class SAMLConfigBean {
private final Set<String> authnContexts;

SAMLConfigBean(final String adfsHostName,
final Resource keyStoreResource,
final Resource keystoreResource,
final String keystoreAlias,
final String keystorePassword,
final String keystorePrivateKeyPassword,
Expand All @@ -90,7 +90,7 @@ public final class SAMLConfigBean {
//@formatter:off
this.adfsHostName = expect(adfsHostName, "ADFS host name").not().toBeBlank().check();

this.keyStoreResource = (Resource) expect(keyStoreResource, "Key store").not().toBeNull().check();
this.keystoreResource = (Resource) expect(keystoreResource, "Key store").not().toBeNull().check();
this.keystoreAlias = expect(keystoreAlias, "Keystore alias").not().toBeBlank().check();
this.keystorePassword = expect(keystorePassword, "Keystore password").not().toBeBlank().check();
this.keystorePrivateKeyPassword = expect(keystorePrivateKeyPassword, "Keystore private key password").not().toBeBlank().check();
Expand All @@ -110,8 +110,8 @@ public String getAdfsHostName() {
return adfsHostName;
}

public Resource getKeyStoreResource() {
return keyStoreResource;
public Resource getKeystoreResource() {
return keystoreResource;
}

public String getKeystoreAlias() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
public final class SAMLConfigBeanBuilder {
private String adfsHostName;
private Resource keyStoreResource;
private Resource keystoreResource;
private String keystoreAlias;
private String keystorePassword;
private String keystorePrivateKeyPassword;
Expand All @@ -25,8 +25,8 @@ public SAMLConfigBeanBuilder setAdfsHostName(final String adfsHostName) {
return this;
}

public SAMLConfigBeanBuilder setKeyStoreResource(final Resource keyStoreResource) {
this.keyStoreResource = keyStoreResource;
public SAMLConfigBeanBuilder setKeystoreResource(final Resource keystoreResource) {
this.keystoreResource = keystoreResource;
return this;
}

Expand Down Expand Up @@ -72,7 +72,7 @@ public SAMLConfigBeanBuilder setAuthnContexts(final Set<String> authnContexts) {

public SAMLConfigBean createSAMLConfigBean() {
return new SAMLConfigBean(adfsHostName,
keyStoreResource,
keystoreResource,
keystoreAlias,
keystorePassword,
keystorePrivateKeyPassword,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public SAMLDefaultLogger samlLogger() {
// Central storage of cryptographic keys
@Bean
public KeyManager keyManager() {
return new JKSKeyManager(samlConfigBean().getKeyStoreResource(),
return new JKSKeyManager(samlConfigBean().getKeystoreResource(),
samlConfigBean().getKeystorePassword(),
ImmutableMap.of(samlConfigBean().getKeystoreAlias(),
samlConfigBean().getKeystorePrivateKeyPassword()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SAMLConfigBeanSpec extends Specification {
}
def allFieldsBeanBuilder = new SAMLConfigBeanBuilder().
setAdfsHostName('adfsHostName').
setKeyStoreResource(keystoreResource).
setKeystoreResource(keystoreResource).
setKeystoreAlias('keystoreAlias').
setKeystorePassword('keystorePassword').
setKeystorePrivateKeyPassword('keystorePrivateKeyPassword').
Expand All @@ -40,7 +40,7 @@ class SAMLConfigBeanSpec extends Specification {

then:
bean.adfsHostName == 'adfsHostName'
bean.keyStoreResource == keystoreResource
bean.keystoreResource == keystoreResource
bean.keystoreAlias == 'keystoreAlias'
bean.keystorePassword == 'keystorePassword'
bean.keystorePrivateKeyPassword == 'keystorePrivateKeyPassword'
Expand All @@ -61,7 +61,7 @@ class SAMLConfigBeanSpec extends Specification {

then:
bean.adfsHostName == 'adfsHostName'
bean.keyStoreResource == keystoreResource
bean.keystoreResource == keystoreResource
bean.keystoreAlias == 'keystoreAlias'
bean.keystorePassword == 'keystorePassword'
bean.keystorePrivateKeyPassword == 'keystorePrivateKeyPassword'
Expand Down Expand Up @@ -93,7 +93,7 @@ class SAMLConfigBeanSpec extends Specification {
where:
field | expectedException
'AdfsHostName' | StringBlankPreconditionException
'KeyStoreResource' | ObjectNullPreconditionException
'KeystoreResource' | ObjectNullPreconditionException
'KeystoreAlias' | StringBlankPreconditionException
'KeystorePassword' | StringBlankPreconditionException
'KeystorePrivateKeyPassword' | StringBlankPreconditionException
Expand Down

0 comments on commit bc03ebc

Please sign in to comment.