-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finally got the configuration working
- Loading branch information
Showing
3 changed files
with
53 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
169 changes: 22 additions & 147 deletions
169
pac4j-module/src/main/java/net/unicon/shibui/pac4j/Pac4jConfigurationProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,172 +1,47 @@ | ||
| package net.unicon.shibui.pac4j; | ||
|
|
||
| import javax.servlet.Filter; | ||
|
|
||
| import org.pac4j.springframework.security.web.CallbackFilter; | ||
| import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
| import org.springframework.boot.context.properties.ConfigurationProperties; | ||
| import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
| import lombok.Getter; | ||
| import lombok.Setter; | ||
|
|
||
| @Component | ||
| @ConfigurationProperties(prefix = "shibui.pac4j") | ||
| @EnableConfigurationProperties | ||
| @ConditionalOnProperty(name = "shibui.pac4j-enabled", havingValue = "true") | ||
| @Getter | ||
| @Setter | ||
| public class Pac4jConfigurationProperties { | ||
| final static String DEFAULT_AUTH_HEADER = "REMOTE_USER"; | ||
|
|
||
| private String keystorePath = "/tmp/samlKeystore.jks"; | ||
| private String keystorePassword = "changeit"; | ||
| private String privateKeyPassword = "changeit"; | ||
| final static String DEFAULT_AUTH_HEADER = "REMOTE_USER"; | ||
| private String authenticationHeader = DEFAULT_AUTH_HEADER; | ||
| private String callbackUrl; | ||
| private boolean forceServiceProviderMetadataGeneration = false; | ||
| private String identityProviderMetadataPath = "/tmp/idp-metadata.xml"; | ||
| private String keystorePassword = "changeit"; | ||
| private String keystorePath = "/tmp/samlKeystore.jks"; | ||
| private int maximumAuthenticationLifetime = 3600; | ||
| private String privateKeyPassword = "changeit"; | ||
| private SAML2ProfileMapping saml2ProfileMapping; | ||
| private String serviceProviderEntityId = "https://unicon.net/shibui"; | ||
| private String serviceProviderMetadataPath = "/tmp/sp-metadata.xml"; | ||
| private boolean forceServiceProviderMetadataGeneration = false; | ||
| private String callbackUrl; | ||
| private boolean wantAssertionsSigned = true; | ||
| private SAML2ProfileMapping saml2ProfileMapping; | ||
| private String typeOfAuth = "SAML2"; | ||
| private String authenticationHeader = DEFAULT_AUTH_HEADER; | ||
|
|
||
| private boolean wantAssertionsSigned = true; | ||
|
|
||
| @Getter | ||
| @Setter | ||
| public static class SAML2ProfileMapping { | ||
| private String username; | ||
| private String email; | ||
| private String firstName; | ||
| private String lastName; | ||
|
|
||
| public String getUsername() { | ||
| return username; | ||
| } | ||
|
|
||
| public void setUsername(String username) { | ||
| this.username = username; | ||
| } | ||
|
|
||
| public String getEmail() { | ||
| return email; | ||
| } | ||
|
|
||
| public void setEmail(String email) { | ||
| this.email = email; | ||
| } | ||
|
|
||
| public String getFirstName() { | ||
| return firstName; | ||
| } | ||
|
|
||
| public void setFirstName(String firstName) { | ||
| this.firstName = firstName; | ||
| } | ||
|
|
||
| public String getLastName() { | ||
| return lastName; | ||
| } | ||
|
|
||
| public void setLastName(String lastName) { | ||
| this.lastName = lastName; | ||
| } | ||
| } | ||
|
|
||
| public String getKeystorePath() { | ||
| return keystorePath; | ||
| } | ||
|
|
||
| public void setKeystorePath(String keystorePath) { | ||
| this.keystorePath = keystorePath; | ||
| } | ||
|
|
||
| public String getKeystorePassword() { | ||
| return keystorePassword; | ||
| } | ||
|
|
||
| public void setKeystorePassword(String keystorePassword) { | ||
| this.keystorePassword = keystorePassword; | ||
| } | ||
|
|
||
| public String getPrivateKeyPassword() { | ||
| return privateKeyPassword; | ||
| } | ||
|
|
||
| public void setPrivateKeyPassword(String privateKeyPassword) { | ||
| this.privateKeyPassword = privateKeyPassword; | ||
| } | ||
|
|
||
| public String getIdentityProviderMetadataPath() { | ||
| return identityProviderMetadataPath; | ||
| } | ||
|
|
||
| public void setIdentityProviderMetadataPath(String identityProviderMetadataPath) { | ||
| this.identityProviderMetadataPath = identityProviderMetadataPath; | ||
| } | ||
|
|
||
| public int getMaximumAuthenticationLifetime() { | ||
| return maximumAuthenticationLifetime; | ||
| } | ||
|
|
||
| public void setMaximumAuthenticationLifetime(int maximumAuthenticationLifetime) { | ||
| this.maximumAuthenticationLifetime = maximumAuthenticationLifetime; | ||
| } | ||
|
|
||
| public String getServiceProviderEntityId() { | ||
| return serviceProviderEntityId; | ||
| } | ||
|
|
||
| public void setServiceProviderEntityId(String serviceProviderEntityId) { | ||
| this.serviceProviderEntityId = serviceProviderEntityId; | ||
| } | ||
|
|
||
| public String getServiceProviderMetadataPath() { | ||
| return serviceProviderMetadataPath; | ||
| } | ||
|
|
||
| public void setServiceProviderMetadataPath(String serviceProviderMetadataPath) { | ||
| this.serviceProviderMetadataPath = serviceProviderMetadataPath; | ||
| } | ||
|
|
||
| public boolean isForceServiceProviderMetadataGeneration() { | ||
| return forceServiceProviderMetadataGeneration; | ||
| } | ||
|
|
||
| public void setForceServiceProviderMetadataGeneration(boolean forceServiceProviderMetadataGeneration) { | ||
| this.forceServiceProviderMetadataGeneration = forceServiceProviderMetadataGeneration; | ||
| } | ||
|
|
||
| public String getCallbackUrl() { | ||
| return callbackUrl; | ||
| } | ||
|
|
||
| public void setCallbackUrl(String callbackUrl) { | ||
| this.callbackUrl = callbackUrl; | ||
| } | ||
|
|
||
| public boolean isWantAssertionsSigned() { | ||
| return wantAssertionsSigned; | ||
| } | ||
|
|
||
| public void setWantAssertionsSigned(boolean wantAssertionsSigned) { | ||
| this.wantAssertionsSigned = wantAssertionsSigned; | ||
| } | ||
|
|
||
| public SAML2ProfileMapping getSaml2ProfileMapping() { | ||
| return saml2ProfileMapping; | ||
| } | ||
|
|
||
| public void setSaml2ProfileMapping(SAML2ProfileMapping saml2ProfileMapping) { | ||
| this.saml2ProfileMapping = saml2ProfileMapping; | ||
| } | ||
|
|
||
| public String getTypeOfAuth() { | ||
| return typeOfAuth; | ||
| } | ||
|
|
||
| public void setTypeOfAuth(String typeOfAuth) { | ||
| this.typeOfAuth = typeOfAuth; | ||
| } | ||
|
|
||
| public String getAuthenticationHeader() { | ||
| return authenticationHeader; | ||
| } | ||
|
|
||
| public void setAuthenticationHeader(String authenticationHeader) { | ||
| this.authenticationHeader = authenticationHeader; | ||
| } | ||
| private String username; | ||
| } | ||
| } | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters