Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 98 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,98 @@
/.gradle/
/target/
/build/
/bin/
# Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar

# Gradle
**/build/
.gradle
gradle-app.setting
!gradle-wrapper.jar
!gradle-wrapper.properties
.gradletasknamecache

# Java
*.class
*.log
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
hs_err_pid*
replay_pid*

# Eclipse
# CRITICAL: For multi-module projects, DO NOT ignore .project, .classpath, or .settings/
# These files MUST be committed for clean customer import experience
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.loadpath
.recommenders
.externalToolBuilders/
*.launch
.buildpath
.target
.tern-project
.texlipse
.springBeans
.recommenders/
.apt_generated/
.apt_generated_test/
.factorypath
.c9/
*.pydevproject
.cproject
.autotools
.externalToolBuilders/
.launches/

# IntelliJ IDEA
.idea/
*.iws
*.iml
*.ipr
out/
.idea_modules/

# VS Code
.vscode/
*.code-workspace
.history/

# macOS
.DS_Store
.AppleDouble
.LSOverride
Icon
._*

# Windows
Thumbs.db
ehthumbs.db
*.stackdump
[Dd]esktop.ini
$RECYCLE.BIN/
*.lnk

# Linux
*~
.fuse_hidden*
.directory
.Trash-*
.nfs*
4 changes: 2 additions & 2 deletions .settings/org.eclipse.wst.common.project.facet.core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<faceted-project>
<fixed facet="jst.java"/>
<fixed facet="jst.web"/>
<installed facet="jst.web" version="2.4"/>
<installed facet="jst.java" version="1.8"/>
<installed facet="jst.web" version="6.0"/>
<installed facet="jst.java" version="17"/>
</faceted-project>
17 changes: 17 additions & 0 deletions cics-java-liberty-springboot-security-app/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin/main" path="src/main/java">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/main" path="src/main/resources">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
37 changes: 37 additions & 0 deletions cics-java-liberty-springboot-security-app/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.ibm.cicsdev.springboot.security</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
connection.project.dir=
eclipse.preferences.version=1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="com.ibm.cicsdev.springboot.security">
<property name="context-root" value="cics-java-liberty-springboot-security"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/java"/>
<wb-resource deploy-path="/" source-path="src/main/webapp"/>
</wb-module>
</project-modules>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="jst.java"/>
<fixed facet="jst.web"/>
<installed facet="jst.web" version="6.0"/>
<installed facet="jst.java" version="17"/>
</faceted-project>
File renamed without changes.
90 changes: 90 additions & 0 deletions cics-java-liberty-springboot-security-app/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<!-- Inherit from parent POM -->
<parent>
<groupId>com.ibm.cicsdev.springboot</groupId>
<artifactId>cics-java-liberty-springboot-security</artifactId>
<version>0.1.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<!-- Application module properties -->
<artifactId>cics-java-liberty-springboot-security-app</artifactId>
<name>com.ibm.cicsdev.springboot.security.app</name>
<description>Spring Boot Web Secure Sample with Jakarta EE pre-authentication - Application</description>
<packaging>war</packaging>
<properties>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>${java.version}</maven.compiler.release>
<spring-boot.repackage.skip>true</spring-boot.repackage.skip>
</properties>

<!-- Dependency Management -->
<dependencyManagement>
<dependencies>
<!-- CICS TS V6.1 BOM -->
<dependency>
<groupId>com.ibm.cics</groupId>
<artifactId>com.ibm.cics.ts.bom</artifactId>
<version>6.1-20250812133513-PH63856</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- Compile against, but don't include JCICS in the final build (version and scope are from BOM) -->
<dependency>
<groupId>com.ibm.cics</groupId>
<artifactId>com.ibm.cics.server</artifactId>
</dependency>

<!-- Spring Boot web support -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<!-- Compile against, but don't include TomCat in the runtime build -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>

<!-- Spring Boot security -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>

<!-- Thymeleaf templates (Web framework) -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>${java.version}</release>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

Expand Down Expand Up @@ -53,10 +54,15 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception
http
.authorizeHttpRequests(authz -> authz
// Allow access to URLs required for form login
.requestMatchers("/login", "/resources/**", "/j_security_check","css/**").permitAll()
.requestMatchers("/login", "/resources/**", "/j_security_check", "/css/**").permitAll()
.anyRequest().authenticated()
)
// Use Jakarta EE pre-authentication and map these roles to Spring Security
// Disable CSRF for j_security_check — this endpoint is handled by Liberty's
// Java EE form authentication, not by Spring Security, so no CSRF token is
// available in the form POST. All other endpoints retain CSRF protection.
.csrf(csrf -> csrf
.ignoringRequestMatchers(new AntPathRequestMatcher("/j_security_check"))
)
.jee(jee -> jee.mappableRoles("USER", "ADMIN"));

return http.build();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
spring.thymeleaf.cache=false

# Spring Security user (used for local/standalone testing only —
# overridden by Liberty SAF/RACF authentication when deployed to CICS)
spring.security.user.name=user
spring.security.user.password=password

# Logging — set to DEBUG for detailed Spring Security filter chain diagnostics
# (useful when troubleshooting authentication/authorisation issues on Liberty)
# Switch back to INFO for normal operation
logging.level.org.springframework.security=DEBUG
logging.level.org.springframework.web=INFO
logging.level.org.springframework.boot.actuate.audit.listener.AuditListener=DEBUG
34 changes: 34 additions & 0 deletions cics-java-liberty-springboot-security-cicsbundle/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// ============================================================================
// Plugins
// ============================================================================
plugins
{
id 'com.ibm.cics.bundle' version '1.0.8'
}

// ============================================================================
// Project Information
// ============================================================================
description = 'CICS Spring Boot Security Application - CICS Bundle'
version = '0.1.0'

// ============================================================================
// Dependencies
// ============================================================================
dependencies
{
// Application WAR from sibling project
cicsBundlePart project(path: ':cics-java-liberty-springboot-security-app', configuration: 'archives')
}

// ============================================================================
// CICS Bundle Configuration
// ============================================================================
cicsBundle
{
build
{
defaultJVMServer = project.findProperty('cics.jvmserver') ?: 'DFHWLP'
}
}

Loading