Skip to content

Commit

Permalink
Merge pull request #26 from boylesoftware/issue-25
Browse files Browse the repository at this point in the history
Issue 25
  • Loading branch information
levahim authored Feb 2, 2020
2 parents a22365b + fd3e66f commit 8091a0c
Show file tree
Hide file tree
Showing 7 changed files with 187 additions and 120 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# OpenID Connect Authenticator for Tomcat

This is an authenticator implementation for [Apache Tomcat](http://tomcat.apache.org/) 9.0, 8.5 and 8.0 that allows web-applications to use [OpenID Connect](http://openid.net/connect/) to log users in.
This is an authenticator implementation for [Apache Tomcat](http://tomcat.apache.org/) 9.0 and 8.5 that allows web-applications to use [OpenID Connect](http://openid.net/connect/) to log users in.

References to Tomcat documenation in this manual link to Tomcat version 9.0. Corresponding pages for Tomcat 8.5 and 8.0 can be easily found on the Apache Tomcat website.
References to Tomcat documenation in this manual link to Tomcat version 9.0. Corresponding pages for Tomcat 8.5 can be easily found on the Apache Tomcat website.

A complete sample web-application is available at https://github.com/boylesoftware/tomcat-oidcauth-sample.

Expand Down Expand Up @@ -41,7 +41,7 @@ https://boylesoftware.com/maven/repo-os/org/bsworks/catalina/authenticator/oidc/

The JAR need to be added to the Tomcat's classpath, for example, by placing it in `$CATALINA_BASE/lib` directory (see Tomcat's [Class Loader How-To](https://tomcat.apache.org/tomcat-9.0-doc/class-loader-howto.html) for more info).

Tomcat versions 9.0 and 8.5 have slightly different interface for the authenticators compared to version 8.0. That is why there are binaries of the authenticator for each version of Tomcat. Make sure that you use one built for the correct Tomcat version.
There are separate binaries of the authenticator for Tomcat version 8.5 and 9.0. Make sure that you use one that's built for your version of Tomcat.

## Configuration

Expand All @@ -52,10 +52,10 @@ The authenticator is added to Tomcat configuration as a [Valve](https://tomcat.a
providers="..." />
```

For Tomcat 8.0 it will look like the following:
For Tomcat 8.5 it will look like the following:

```xml
<Valve className="org.bsworks.catalina.authenticator.oidc.tomcat80.OpenIDConnectAuthenticator"
<Valve className="org.bsworks.catalina.authenticator.oidc.tomcat85.OpenIDConnectAuthenticator"
providers="..." />
```

Expand Down
38 changes: 9 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,13 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'

group = 'org.bsworks.catalina.authenticator.oidc'
version = '2.2.5'
version = '2.3.0'

task jar(type: Jar, overwrite: true) {}
jar.enabled = false
javadoc.enabled = false
sourceSets.remove(sourceSets.main)

sourceSets {
mainTomcat80 {
java {
srcDirs = ['src/common/java', 'src/tomcat80/java']
}
}
mainTomcat85 {
java {
srcDirs = ['src/common/java', 'src/tomcat85/java']
Expand All @@ -37,7 +31,7 @@ sourceSets {
}

task compileJava(type: JavaCompile, overwrite: true) {
dependsOn compileMainTomcat80Java, compileMainTomcat85Java, compileMainTomcat90Java
dependsOn compileMainTomcat85Java, compileMainTomcat90Java
}

ext.sharedManifest = manifest {
Expand All @@ -48,13 +42,6 @@ ext.sharedManifest = manifest {
)
}

task mainTomcat80Jar(type: Jar) {
classifier = 'tomcat80'
from sourceSets.mainTomcat80.output
manifest = project.manifest {
from sharedManifest
}
}
task mainTomcat85Jar(type: Jar) {
classifier 'tomcat85'
from sourceSets.mainTomcat85.output
Expand All @@ -75,26 +62,20 @@ repositories {
}

dependencies {
mainTomcat80Implementation(
'org.apache.tomcat:tomcat-catalina:8.0.+',
'org.apache.tomcat:tomcat-juli:8.0.+',
'org.apache.tomcat:tomcat-util:8.0.+'
)
mainTomcat85Implementation(
'org.apache.tomcat:tomcat-catalina:8.5.+',
'org.apache.tomcat:tomcat-juli:8.5.+',
'org.apache.tomcat:tomcat-util:8.5.+'
'org.apache.tomcat:tomcat-catalina:[8.5.50,8.6.0)',
'org.apache.tomcat:tomcat-juli:[8.5.50,8.6.0)',
'org.apache.tomcat:tomcat-util:[8.5.50,8.6.0)'
)
mainTomcat90Implementation(
'org.apache.tomcat:tomcat-catalina:9.0.+',
'org.apache.tomcat:tomcat-juli:9.0.+',
'org.apache.tomcat:tomcat-util:9.0.+'
'org.apache.tomcat:tomcat-catalina:[9.0.30,9.1.0)',
'org.apache.tomcat:tomcat-juli:[9.0.30,9.1.0)',
'org.apache.tomcat:tomcat-util:[9.0.30,9.1.0)'
)
}

artifacts {
archives(
mainTomcat80Jar,
mainTomcat85Jar,
mainTomcat90Jar
)
Expand Down Expand Up @@ -135,14 +116,13 @@ publishing {
url = 'https://github.com/boylesoftware/tomcat-oidcauth/issues'
}
}
artifact mainTomcat80Jar
artifact mainTomcat85Jar
artifact mainTomcat90Jar
}
}
repositories {
maven {
name = 'Boyle Software Open Source Maven Repository'
name = 'local'
url = "file://${buildDir}/repo"
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 8091a0c

Please sign in to comment.