-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
break down token functionality into 3 distinct modules
- Loading branch information
1 parent
5eb976a
commit b163f59
Showing
26 changed files
with
187 additions
and
71 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
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
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
19 changes: 19 additions & 0 deletions
19
support/cas-server-support-token-authentication/build.gradle
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
description = "Apereo CAS JWT Token Authentication Support" | ||
dependencies { | ||
compile project(":api:cas-server-core-api") | ||
compile project(":core:cas-server-core-web") | ||
compile project(":core:cas-server-core-webflow") | ||
compile project(":core:cas-server-core-authentication") | ||
compile project(":core:cas-server-core-services") | ||
compile project(":support:cas-server-support-pac4j-authentication") | ||
compile project(":support:cas-server-support-token-core") | ||
|
||
implementation libraries.pac4j | ||
implementation libraries.casclient | ||
testImplementation project(":core:cas-server-core-authentication") | ||
testImplementation project(":core:cas-server-core") | ||
testImplementation project(":core:cas-server-core-logout") | ||
testImplementation project(":support:cas-server-support-cookie") | ||
testImplementation project(path: ":core:cas-server-core-authentication", configuration: "tests") | ||
testImplementation project(path: ":core:cas-server-core-util", configuration: "tests") | ||
} |
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../main/resources/META-INF/spring.factories → .../main/resources/META-INF/spring.factories
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 +1 @@ | ||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=org.apereo.cas.token.config.TokenAuthenticationConfiguration | ||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=org.apereo.cas.config.TokenAuthenticationConfiguration |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions
18
...-support-token-core/src/main/java/org/apereo/cas/token/config/TokenCoreConfiguration.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.apereo.cas.token.config; | ||
|
||
import org.apereo.cas.configuration.CasConfigurationProperties; | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
/** | ||
* This is {@link TokenCoreConfiguration}. | ||
* | ||
* @author Misagh Moayyed | ||
* @since 5.0.0 | ||
*/ | ||
@Configuration("tokenAuthenticationConfiguration") | ||
@EnableConfigurationProperties(CasConfigurationProperties.class) | ||
public class TokenCoreConfiguration { | ||
|
||
|
||
} |
1 change: 1 addition & 0 deletions
1
support/cas-server-support-token-core/src/main/resources/META-INF/spring.factories
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=org.apereo.cas.token.config.TokenCoreConfiguration |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
description = "Apereo CAS JWT Token Authentication Support" | ||
dependencies { | ||
compile project(":api:cas-server-core-api") | ||
compile project(":core:cas-server-core-web") | ||
compile project(":core:cas-server-core-webflow") | ||
compile project(":core:cas-server-core-authentication") | ||
compile project(":core:cas-server-core-services") | ||
compile project(":support:cas-server-support-token-core") | ||
compile project(":support:cas-server-support-pac4j-authentication") | ||
testImplementation project(":core:cas-server-core-authentication") | ||
testImplementation project(":core:cas-server-core") | ||
testImplementation project(":core:cas-server-core-logout") | ||
testImplementation project(":support:cas-server-support-cookie") | ||
testImplementation project(path: ":core:cas-server-core-authentication", configuration: "tests") | ||
testImplementation project(path: ":core:cas-server-core-util", configuration: "tests") | ||
|
||
} |
56 changes: 56 additions & 0 deletions
56
...-support-token-tickets/src/main/java/org/apereo/cas/config/TokenTicketsConfiguration.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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package org.apereo.cas.config; | ||
|
||
import org.apereo.cas.CipherExecutor; | ||
import org.apereo.cas.authentication.principal.ResponseBuilder; | ||
import org.apereo.cas.configuration.CasConfigurationProperties; | ||
import org.apereo.cas.configuration.model.core.util.CryptographyProperties; | ||
import org.apereo.cas.services.ServicesManager; | ||
import org.apereo.cas.ticket.ExpirationPolicy; | ||
import org.apereo.cas.token.authentication.principal.TokenWebApplicationServiceResponseBuilder; | ||
import org.apereo.cas.token.cipher.TokenTicketCipherExecutor; | ||
import org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
/** | ||
* This is {@link TokenTicketsConfiguration}. | ||
* | ||
* @author Misagh Moayyed | ||
* @since 5.2.0 | ||
*/ | ||
@Configuration("tokenTicketsConfiguration") | ||
@EnableConfigurationProperties(CasConfigurationProperties.class) | ||
public class TokenTicketsConfiguration { | ||
@Autowired | ||
private CasConfigurationProperties casProperties; | ||
|
||
@Autowired | ||
@Qualifier("casClientTicketValidator") | ||
private AbstractUrlBasedTicketValidator casClientTicketValidator; | ||
|
||
@Autowired | ||
@Qualifier("grantingTicketExpirationPolicy") | ||
private ExpirationPolicy grantingTicketExpirationPolicy; | ||
|
||
@Autowired | ||
@Qualifier("servicesManager") | ||
private ServicesManager servicesManager; | ||
|
||
@Bean | ||
public ResponseBuilder webApplicationServiceResponseBuilder() { | ||
return new TokenWebApplicationServiceResponseBuilder(servicesManager, | ||
tokenCipherExecutor(), | ||
grantingTicketExpirationPolicy, | ||
casClientTicketValidator); | ||
} | ||
|
||
@Bean | ||
public CipherExecutor tokenCipherExecutor() { | ||
final CryptographyProperties crypto = casProperties.getAuthn().getToken().getCrypto(); | ||
return new TokenTicketCipherExecutor(crypto.getEncryption().getKey(), crypto.getSigning().getKey()); | ||
} | ||
|
||
} |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
support/cas-server-support-token-tickets/src/main/resources/META-INF/spring.factories
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=org.apereo.cas.config.TokenTicketsConfiguration |
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
25 changes: 25 additions & 0 deletions
25
support/cas-server-support-token-tickets/src/test/resources/log4j2.xml
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<Configuration shutdownHook="disable"> | ||
<Appenders> | ||
<Console name="console" target="SYSTEM_OUT"> | ||
<PatternLayout pattern="%d %p [%c] - <%m>%n"/> | ||
</Console> | ||
<RollingFile name="file" fileName="build/jwttokentickets.log" append="true" | ||
filePattern="mongo-%d{yyyy-MM-dd-HH}-%i.log.gz"> | ||
<PatternLayout pattern="%d %p [%c] - %m%n"/> | ||
<Policies> | ||
<OnStartupTriggeringPolicy /> | ||
<SizeBasedTriggeringPolicy size="10 MB"/> | ||
<TimeBasedTriggeringPolicy /> | ||
</Policies> | ||
</RollingFile> | ||
</Appenders> | ||
<Loggers> | ||
<Logger name="org.apereo" level="info" additivity="false"> | ||
<AppenderRef ref="console"/> | ||
</Logger> | ||
<Root level="warn"> | ||
<AppenderRef ref="console"/> | ||
</Root> | ||
</Loggers> | ||
</Configuration> |
Empty file.
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,6 +1,6 @@ | ||
|
||
description = "Apereo CAS Token Authentication Webflow Support" | ||
dependencies { | ||
compile project(":core:cas-server-core-webflow") | ||
compile project(":support:cas-server-support-token") | ||
compile project(":support:cas-server-support-token-core") | ||
compile project(":support:cas-server-support-token-authentication") | ||
} |
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
Oops, something went wrong.