[java-idp-plugin-duo] branch main updated: Re-organise plugin and module information
Phil Smart
philip.smart at jisc.ac.uk
Tue Nov 24 16:42:23 UTC 2020
This is an automated email from the git hooks/post-receive script.
philsmart pushed a commit to branch main
in repository java-idp-plugin-duo.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-duo.git;a=commit;h=3062ff2b3ff487d938a552f4e1936804611f12b3
The following commit(s) were added to refs/heads/main by this push:
new 3062ff2 Re-organise plugin and module information
3062ff2 is described below
commit 3062ff2b3ff487d938a552f4e1936804611f12b3
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Tue Nov 24 16:42:16 2020 +0000
Re-organise plugin and module information
- Create two distinct plugins for the Nimbus and Duo WebSDK v4 clients
- Cleanup POMs
- Fix minor syntax and javadoc issues
---
idp-duo-api/pom.xml | 23 +++++++-----------
.../src/main/assembly/duo-native-sdk-assembly.xml | 2 +-
.../src/main/assembly/duo-nimbus-assembly.xml | 2 +-
idp-duo-impl/pom.xml | 22 +++++------------
.../idp/plugin/authn/duo/DuoOIDCModule.java | 24 -------------------
.../impl/ValidateDuoTokenAuthenticationResult.java | 2 +-
.../services/net.shibboleth.idp.module.IdPModule | 1 -
.../services/net.shibboleth.idp.plugin.IdPPlugin | 1 -
.../plugin/authn/mock/MockDuoOIDCClient_FAIL.java | 3 +--
.../plugin/authn/mock/MockDuoOIDCClient_OK.java | 3 +--
.../mock/MockDuoOIDCClient_OK_OLD_AUTH_TIME.java | 3 +--
.../authn/mock/MockDuoOIDCClient_UNKNOWN.java | 3 +--
idp-duo-native-client-impl/pom.xml | 14 +++++++----
.../plugin/authn/duo/sdk/DuoOIDCWebSDKModule.java | 28 +++++++++++++---------
.../plugin/authn/duo/sdk/DuoOIDCWebSDKPlugin.java | 19 +++++++++------
.../plugin/authn/duo/sdk/impl/package-info.java | 2 +-
.../authn/duo/sdk/{impl => }/package-info.java | 4 ++--
.../services/net.shibboleth.idp.module.IdPModule | 1 +
.../services/net.shibboleth.idp.plugin.IdPPlugin | 1 +
.../duo/sdk}/conf/authn/duo-oidc-authn-config.xml | 0
.../authn/duo/sdk}/conf/authn/duo-oidc.properties | 2 +-
.../idp/plugin/authn/duo/sdk}/module.properties | 8 +++----
.../idp/plugin/authn/duo/sdk}/plugin.properties | 2 +-
.../duo/sdk/impl/DuoSDKClientFactoryTest.java | 3 +++
idp-duo-nimbus-client-impl/pom.xml | 21 ++++++----------
...ntFactoryBean.java => DuoOIDCNimbusModule.java} | 27 ++++++++++++---------
.../authn/duo/nimbus/DuoOIDCNimbusPlugin.java | 19 +++++++++------
.../{ => impl}/DuoHttpClientFactoryBean.java | 2 +-
.../authn/duo/nimbus/{ => impl}/NimbusClient.java | 8 +++----
.../duo/nimbus/{ => impl}/NimbusClientFactory.java | 2 +-
.../duo/nimbus/{ => impl}/NimbusClientSupport.java | 6 ++++-
.../authn/duo/nimbus/{ => impl}/TokenResponse.java | 2 +-
.../authn/duo/nimbus}/impl/package-info.java | 4 ++--
.../idp/plugin/authn/duo/nimbus}/package-info.java | 4 ++--
.../services/net.shibboleth.idp.module.IdPModule | 1 +
.../services/net.shibboleth.idp.plugin.IdPPlugin | 1 +
.../plugin/authn/duo/duo-client-factory-bean.xml | 4 ++--
.../nimbus}/conf/authn/duo-oidc-authn-config.xml | 0
.../duo/nimbus}/conf/authn/duo-oidc.properties | 2 +-
.../idp/plugin/authn/duo/nimbus/module.properties | 12 ++++++++++
.../idp/plugin/authn/duo/nimbus}/plugin.properties | 2 +-
.../plugin/authn/duo/nimbus/{ => impl}/.gitignore | 0
.../nimbus/{ => impl}/NimbusClientFactoryTest.java | 3 ++-
.../nimbus/{ => impl}/NimbusClientSupportTest.java | 3 ++-
.../duo/nimbus/{ => impl}/NimbusClientTest.java | 3 ++-
pom.xml | 13 +++-------
46 files changed, 150 insertions(+), 162 deletions(-)
diff --git a/idp-duo-api/pom.xml b/idp-duo-api/pom.xml
index 663f2e2..4c9e9a6 100644
--- a/idp-duo-api/pom.xml
+++ b/idp-duo-api/pom.xml
@@ -24,33 +24,26 @@
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>${opensaml.groupId}</groupId>
- <artifactId>opensaml-profile-api</artifactId>
- <scope>provided</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>${idp.groupId}</groupId>
- <artifactId>idp-profile-api</artifactId>
+ <artifactId>idp-authn-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>${idp.groupId}</groupId>
- <artifactId>idp-authn-api</artifactId>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>${opensaml.groupId}</groupId>
- <artifactId>opensaml-messaging-api</artifactId>
+ <groupId>com.fasterxml.jackson.datatype</groupId>
+ <artifactId>jackson-datatype-jsr310</artifactId>
<scope>provided</scope>
</dependency>
-
-
<!-- Test dependencies -->
</dependencies>
-
+
<build>
<plugins>
<plugin>
@@ -60,7 +53,7 @@
<archive>
<index>true</index>
<manifestEntries>
- <Main-Class>net.shibboleth.idp.plugin.authn.duo.Version</Main-Class>
+ <Main-Class>net.shibboleth.idp.plugin.authn.duo.Version</Main-Class>
</manifestEntries>
<manifestSections>
<manifestSection>
diff --git a/idp-duo-distribution/src/main/assembly/duo-native-sdk-assembly.xml b/idp-duo-distribution/src/main/assembly/duo-native-sdk-assembly.xml
index 623299a..5d911ea 100644
--- a/idp-duo-distribution/src/main/assembly/duo-native-sdk-assembly.xml
+++ b/idp-duo-distribution/src/main/assembly/duo-native-sdk-assembly.xml
@@ -55,7 +55,7 @@
</fileSet>
<fileSet>
<!-- The shared property file -->
- <directory>../idp-duo-impl/target/classes/net/shibboleth/idp/plugin/authn/duo</directory>
+ <directory>../idp-duo-native-client-impl/target/classes/net/shibboleth/idp/plugin/authn/duo/sdk/</directory>
<outputDirectory>bootstrap</outputDirectory>
<includes>
<include>plugin.properties</include>
diff --git a/idp-duo-distribution/src/main/assembly/duo-nimbus-assembly.xml b/idp-duo-distribution/src/main/assembly/duo-nimbus-assembly.xml
index 41dc43a..fb065f3 100644
--- a/idp-duo-distribution/src/main/assembly/duo-nimbus-assembly.xml
+++ b/idp-duo-distribution/src/main/assembly/duo-nimbus-assembly.xml
@@ -55,7 +55,7 @@
</fileSet>
<fileSet>
<!-- The shared property file -->
- <directory>../idp-duo-impl/target/classes/net/shibboleth/idp/plugin/authn/duo</directory>
+ <directory>../idp-duo-nimbus-client-impl/target/classes/net/shibboleth/idp/plugin/authn/duo/nimbus/</directory>
<outputDirectory>bootstrap</outputDirectory>
<includes>
<include>plugin.properties</include>
diff --git a/idp-duo-impl/pom.xml b/idp-duo-impl/pom.xml
index 01bada9..6df0189 100644
--- a/idp-duo-impl/pom.xml
+++ b/idp-duo-impl/pom.xml
@@ -32,11 +32,7 @@
<artifactId>idp-session-api</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>${idp.groupId}</groupId>
- <artifactId>idp-admin-api</artifactId>
- <scope>provided</scope>
- </dependency>
+
<dependency>
<groupId>${idp.groupId}</groupId>
<artifactId>idp-authn-api</artifactId>
@@ -72,11 +68,7 @@
<artifactId>opensaml-profile-api</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>${opensaml.groupId}</groupId>
- <artifactId>opensaml-core</artifactId>
- <scope>provided</scope>
- </dependency>
+
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
@@ -97,11 +89,9 @@
<artifactId>idp-profile-api</artifactId>
<scope>provided</scope>
</dependency>
-
- <!-- Needed for module/plugin impls. -->
<dependency>
- <groupId>${idp.groupId}</groupId>
- <artifactId>idp-admin-impl</artifactId>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
<scope>provided</scope>
</dependency>
@@ -163,7 +153,7 @@
<exclude>credentials/**</exclude>
</excludes>
</configuration>
- </plugin>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
@@ -185,7 +175,7 @@
</manifestSections>
</archive>
</configuration>
- </plugin>
+ </plugin>
</plugins>
</build>
</project>
\ No newline at end of file
diff --git a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/DuoOIDCModule.java b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/DuoOIDCModule.java
deleted file mode 100644
index 08aceba..0000000
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/DuoOIDCModule.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package net.shibboleth.idp.plugin.authn.duo;
-
-import java.io.IOException;
-
-import net.shibboleth.idp.module.IdPModule;
-import net.shibboleth.idp.module.ModuleException;
-import net.shibboleth.idp.module.impl.PluginIdPModule;
-
-/**
- * {@link IdPModule} implementation.
- */
-public class DuoOIDCModule extends PluginIdPModule {
-
- /**
- * Constructor.
- *
- * @throws IOException if the property file cannot be loaded
- * @throws ModuleException if other errors occur
- */
- public DuoOIDCModule() throws IOException, ModuleException {
- super(DuoOIDCModule.class);
- }
-
-}
\ No newline at end of file
diff --git a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateDuoTokenAuthenticationResult.java b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateDuoTokenAuthenticationResult.java
index a5acc4d..5d24390 100644
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateDuoTokenAuthenticationResult.java
+++ b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateDuoTokenAuthenticationResult.java
@@ -49,7 +49,7 @@ import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
/**
- * A validation action that checks for a valid {@link DuoAuthToken} and directly produces an
+ * A validation action that checks for a valid Duo authentication token and directly produces an
* {@link AuthenticationResult} based on the identity described by the token.
*
* @event {@link org.opensaml.profile.action.EventIds#PROCEED_EVENT_ID}
diff --git a/idp-duo-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule b/idp-duo-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule
deleted file mode 100644
index 1bd79be..0000000
--- a/idp-duo-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule
+++ /dev/null
@@ -1 +0,0 @@
-net.shibboleth.idp.plugin.authn.duo.DuoOIDCModule
diff --git a/idp-duo-impl/src/main/resources/META-INF/services/net.shibboleth.idp.plugin.IdPPlugin b/idp-duo-impl/src/main/resources/META-INF/services/net.shibboleth.idp.plugin.IdPPlugin
deleted file mode 100644
index 3ebb677..0000000
--- a/idp-duo-impl/src/main/resources/META-INF/services/net.shibboleth.idp.plugin.IdPPlugin
+++ /dev/null
@@ -1 +0,0 @@
-net.shibboleth.idp.plugin.authn.duo.DuoOIDCPlugin
diff --git a/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/mock/MockDuoOIDCClient_FAIL.java b/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/mock/MockDuoOIDCClient_FAIL.java
index 953b857..d665f85 100644
--- a/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/mock/MockDuoOIDCClient_FAIL.java
+++ b/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/mock/MockDuoOIDCClient_FAIL.java
@@ -127,9 +127,8 @@ public class MockDuoOIDCClient_FAIL implements DuoOIDCClient{
"}";
try {
- //re-sign the token using the client secret
+ //sign the token using the client secret
final JWSSigner signer = new MACSigner(integration.getSecretKey());
- //FIXME: needs to be HS512 (or not?)
final JWSHeader header = new JWSHeader.Builder(JWSAlgorithm.HS256).build();
final JWTClaimsSet claims = JWTClaimsSet.parse(jwtJson);
final SignedJWT signedJWT = new SignedJWT(header,claims);
diff --git a/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/mock/MockDuoOIDCClient_OK.java b/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/mock/MockDuoOIDCClient_OK.java
index 1e20ac0..bb7018c 100644
--- a/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/mock/MockDuoOIDCClient_OK.java
+++ b/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/mock/MockDuoOIDCClient_OK.java
@@ -124,9 +124,8 @@ public class MockDuoOIDCClient_OK implements DuoOIDCClient{
"}";
try {
- //re-sign the token using the client secret
+ //sign the token using the client secret
final JWSSigner signer = new MACSigner(integration.getSecretKey());
- //FIXME: needs to be HS512 (or not?)
final JWSHeader header = new JWSHeader.Builder(JWSAlgorithm.HS256).build();
final JWTClaimsSet claims = JWTClaimsSet.parse(jwtJson);
final SignedJWT signedJWT = new SignedJWT(header,claims);
diff --git a/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/mock/MockDuoOIDCClient_OK_OLD_AUTH_TIME.java b/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/mock/MockDuoOIDCClient_OK_OLD_AUTH_TIME.java
index 62a54bd..480e4e3 100644
--- a/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/mock/MockDuoOIDCClient_OK_OLD_AUTH_TIME.java
+++ b/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/mock/MockDuoOIDCClient_OK_OLD_AUTH_TIME.java
@@ -126,9 +126,8 @@ public class MockDuoOIDCClient_OK_OLD_AUTH_TIME implements DuoOIDCClient{
"}";
try {
- //re-sign the token using the client secret
+ //sign the token using the client secret
final JWSSigner signer = new MACSigner(integration.getSecretKey());
- //FIXME: needs to be HS512 (or not?)
final JWSHeader header = new JWSHeader.Builder(JWSAlgorithm.HS256).build();
final JWTClaimsSet claims = JWTClaimsSet.parse(jwtJson);
final SignedJWT signedJWT = new SignedJWT(header,claims);
diff --git a/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/mock/MockDuoOIDCClient_UNKNOWN.java b/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/mock/MockDuoOIDCClient_UNKNOWN.java
index 4a17b49..a934585 100644
--- a/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/mock/MockDuoOIDCClient_UNKNOWN.java
+++ b/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/mock/MockDuoOIDCClient_UNKNOWN.java
@@ -123,9 +123,8 @@ public class MockDuoOIDCClient_UNKNOWN implements DuoOIDCClient{
"}";
try {
- //re-sign the token using the client secret
+ //sign the token using the client secret
final JWSSigner signer = new MACSigner(integration.getSecretKey());
- //FIXME: needs to be HS512 (or not?)
final JWSHeader header = new JWSHeader.Builder(JWSAlgorithm.HS256).build();
final JWTClaimsSet claims = JWTClaimsSet.parse(jwtJson);
final SignedJWT signedJWT = new SignedJWT(header,claims);
diff --git a/idp-duo-native-client-impl/pom.xml b/idp-duo-native-client-impl/pom.xml
index 74209a1..4e7bbbd 100644
--- a/idp-duo-native-client-impl/pom.xml
+++ b/idp-duo-native-client-impl/pom.xml
@@ -50,7 +50,7 @@
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-jackson</artifactId>
<version>2.1.0</version>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
@@ -85,14 +85,12 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
- <version>2.7.0</version>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
- <version>1.11</version>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<!-- provided dependencies -->
@@ -111,6 +109,12 @@
<artifactId>idp-authn-api</artifactId>
<scope>provided</scope>
</dependency>
+ <!-- Needed for module/plugin impls. -->
+ <dependency>
+ <groupId>${idp.groupId}</groupId>
+ <artifactId>idp-admin-impl</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/DuoHttpClientFactoryBean.java b/idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/DuoOIDCWebSDKModule.java
similarity index 59%
copy from idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/DuoHttpClientFactoryBean.java
copy to idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/DuoOIDCWebSDKModule.java
index 44b5149..11aaace 100644
--- a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/DuoHttpClientFactoryBean.java
+++ b/idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/DuoOIDCWebSDKModule.java
@@ -15,21 +15,27 @@
* limitations under the License.
*/
+package net.shibboleth.idp.plugin.authn.duo.sdk;
-package net.shibboleth.idp.plugin.authn.duo.nimbus;
+import java.io.IOException;
+import net.shibboleth.idp.module.ModuleException;
-import net.shibboleth.idp.plugin.authn.duo.Version;
+
+import net.shibboleth.idp.module.impl.PluginIdPModule;
/**
- * Factory bean customization for the Duo plugin. Uses the plugin product name and version inside the user_agent string.
+ * {@link PluginIdPModule} implementation based on the Duo Web SDK v4.
*/
-public class DuoHttpClientFactoryBean extends net.shibboleth.ext.spring.factory.HttpClientFactoryBean {
+public class DuoOIDCWebSDKModule extends PluginIdPModule {
- /** Constructor. */
- public DuoHttpClientFactoryBean() {
- final StringBuilder stringBuilder = new StringBuilder("ShibbolethIdPDuoPlugin/");
- stringBuilder.append(Version.getVersion());
- setUserAgent(stringBuilder.toString());
+ /**
+ * Constructor.
+ *
+ * @throws IOException if the property file cannot be loaded
+ * @throws ModuleException if other errors occur
+ */
+ public DuoOIDCWebSDKModule() throws IOException, ModuleException {
+ super(DuoOIDCWebSDKModule.class);
}
-
-}
+
+}
\ No newline at end of file
diff --git a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/DuoOIDCPlugin.java b/idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/DuoOIDCWebSDKPlugin.java
similarity index 73%
copy from idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/DuoOIDCPlugin.java
copy to idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/DuoOIDCWebSDKPlugin.java
index b2273ab..86500a5 100644
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/DuoOIDCPlugin.java
+++ b/idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/DuoOIDCWebSDKPlugin.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.plugin.authn.duo;
+package net.shibboleth.idp.plugin.authn.duo.sdk;
import java.io.IOException;
import java.util.Collections;
@@ -26,16 +26,21 @@ import net.shibboleth.idp.plugin.PluginException;
import net.shibboleth.idp.plugin.impl.FirstPartyIdPPlugin;
/**
- * Details about the Duo OIDC 2FA plugin.
+ * Details about the Duo OIDC 2FA plugin based on the Duo Web SDK v4.
*/
-public class DuoOIDCPlugin extends FirstPartyIdPPlugin{
+public class DuoOIDCWebSDKPlugin extends FirstPartyIdPPlugin{
- /** Constructor.*/
- public DuoOIDCPlugin() throws IOException, PluginException{
- super(DuoOIDCPlugin.class);
+ /**
+ * Constructor.
+ *
+ * @throws IOException if the properties fail to load
+ * @throws PluginException if other errors occur
+ */
+ public DuoOIDCWebSDKPlugin() throws IOException, PluginException{
+ super(DuoOIDCWebSDKPlugin.class);
try {
- final IdPModule module = new DuoOIDCModule();
+ final IdPModule module = new DuoOIDCWebSDKModule();
setEnableOnInstall(Collections.singleton(module));
setDisableOnRemoval(Collections.singleton(module));
} catch (final IOException e) {
diff --git a/idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/package-info.java b/idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/package-info.java
index b84a17a..c3a8342 100644
--- a/idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/package-info.java
+++ b/idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/package-info.java
@@ -15,5 +15,5 @@
* limitations under the License.
*/
-/** Native Duo OIDC 2FA client adaptor implementation classes. */
+/** Duo WebSDK v4 OIDC 2FA client adaptor implementation classes. */
package net.shibboleth.idp.plugin.authn.duo.sdk.impl;
diff --git a/idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/package-info.java b/idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/package-info.java
similarity index 87%
copy from idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/package-info.java
copy to idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/package-info.java
index b84a17a..335c548 100644
--- a/idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/package-info.java
+++ b/idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/package-info.java
@@ -15,5 +15,5 @@
* limitations under the License.
*/
-/** Native Duo OIDC 2FA client adaptor implementation classes. */
-package net.shibboleth.idp.plugin.authn.duo.sdk.impl;
+/** Duo WebSDK v4 OIDC integration plugin. */
+package net.shibboleth.idp.plugin.authn.duo.sdk;
diff --git a/idp-duo-native-client-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule b/idp-duo-native-client-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule
new file mode 100644
index 0000000..b89df72
--- /dev/null
+++ b/idp-duo-native-client-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule
@@ -0,0 +1 @@
+net.shibboleth.idp.plugin.authn.duo.sdk.DuoOIDCWebSDKModule
diff --git a/idp-duo-native-client-impl/src/main/resources/META-INF/services/net.shibboleth.idp.plugin.IdPPlugin b/idp-duo-native-client-impl/src/main/resources/META-INF/services/net.shibboleth.idp.plugin.IdPPlugin
new file mode 100644
index 0000000..909ff65
--- /dev/null
+++ b/idp-duo-native-client-impl/src/main/resources/META-INF/services/net.shibboleth.idp.plugin.IdPPlugin
@@ -0,0 +1 @@
+net.shibboleth.idp.plugin.authn.duo.sdk.DuoOIDCWebSDKPlugin
diff --git a/idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/module/conf/authn/duo-oidc-authn-config.xml b/idp-duo-native-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/sdk/conf/authn/duo-oidc-authn-config.xml
similarity index 100%
copy from idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/module/conf/authn/duo-oidc-authn-config.xml
copy to idp-duo-native-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/sdk/conf/authn/duo-oidc-authn-config.xml
diff --git a/idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/module/conf/authn/duo-oidc.properties b/idp-duo-native-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/sdk/conf/authn/duo-oidc.properties
similarity index 93%
copy from idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/module/conf/authn/duo-oidc.properties
copy to idp-duo-native-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/sdk/conf/authn/duo-oidc.properties
index d470342..2f3f053 100644
--- a/idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/module/conf/authn/duo-oidc.properties
+++ b/idp-duo-native-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/sdk/conf/authn/duo-oidc.properties
@@ -16,7 +16,7 @@ idp.duo.oidc.redirectURL = https://something
# Controls the "back-end" OIDC implementation.
# shibboleth.authn.DuoOIDC.native.sdk.clientFactory (Duo WebSDK-based)
# shibboleth.authn.DuoOIDC.nimbus.clientFactory (Shibboleth Nimbus-based)
-#idp.duo.oidc.clientFactoryBean = shibboleth.authn.DuoOIDC.native.sdk.clientFactory
+idp.duo.oidc.clientFactoryBean = shibboleth.authn.DuoOIDC.native.sdk.clientFactory
# With the Nimbus "client" impl, controls for HttpClient behavior
# These default to the global HttpClient options in services.properties
diff --git a/idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/module.properties b/idp-duo-native-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/sdk/module.properties
similarity index 50%
rename from idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/module.properties
rename to idp-duo-native-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/sdk/module.properties
index a8d3a2a..fe455f0 100644
--- a/idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/module.properties
+++ b/idp-duo-native-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/sdk/module.properties
@@ -1,12 +1,12 @@
# Properties defining plugin module(s)
# Class to Module ID mappings
-net.shibboleth.idp.plugin.authn.duo.DuoOIDCModule = idp.authn.DuoOIDC
+net.shibboleth.idp.plugin.authn.duo.sdk.DuoOIDCWebSDKModule = idp.authn.DuoOIDC
idp.authn.Duo.name = Duo "Universal Prompt" OIDC-based Authentication
-idp.authn.Duo.desc = Login flow for Duo Security's second-factor authentication service using the OIDC-based Universal Prompt
+idp.authn.Duo.desc = Login flow for Duo Security's second-factor authentication service using the OIDC-based Universal Prompt via Duo's WebSDK
idp.authn.Duo.url = /DuoOIDCAuthnConfiguration
-idp.authn.Duo.1.src = /net/shibboleth/idp/plugin/authn/duo/module/conf/authn/duo-oidc-authn-config.xml
+idp.authn.Duo.1.src = /net/shibboleth/idp/plugin/authn/duo/sdk/conf/authn/duo-oidc-authn-config.xml
idp.authn.Duo.1.dest = conf/authn/duo-oidc-authn-config.xml
-idp.authn.Duo.2.src = /net/shibboleth/idp/plugin/authn/duo/module/conf/authn/duo-oidc.properties
+idp.authn.Duo.2.src = /net/shibboleth/idp/plugin/authn/duo/sdk/conf/authn/duo-oidc.properties
idp.authn.Duo.2.dest = conf/authn/duo-oidc.properties
diff --git a/idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/plugin.properties b/idp-duo-native-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/sdk/plugin.properties
similarity index 74%
copy from idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/plugin.properties
copy to idp-duo-native-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/sdk/plugin.properties
index ccd69b4..9bd7b37 100644
--- a/idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/plugin.properties
+++ b/idp-duo-native-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/sdk/plugin.properties
@@ -1,6 +1,6 @@
# Properties defining this plugin
-plugin.id = net.shibboleth.idp.plugin.authn.duo
+plugin.id = net.shibboleth.idp.plugin.authn.duo.sdk
# Only used when package manifest is not available
plugin.version = 1.0.0
diff --git a/idp-duo-native-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/DuoSDKClientFactoryTest.java b/idp-duo-native-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/DuoSDKClientFactoryTest.java
index ba6ef51..7e0f167 100644
--- a/idp-duo-native-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/DuoSDKClientFactoryTest.java
+++ b/idp-duo-native-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/DuoSDKClientFactoryTest.java
@@ -46,10 +46,13 @@ import net.shibboleth.idp.plugin.authn.duo.DefaultDuoOIDCIntegration;
import net.shibboleth.idp.plugin.authn.duo.DuoClientException;
import net.shibboleth.idp.plugin.authn.duo.DuoOIDCClient;
+/** Test for the DuoSDKClientFactory.*/
public class DuoSDKClientFactoryTest {
+ /** The factory to test.*/
private DuoSDKClientFactory factory;
+ /** Setup.*/
@BeforeMethod
public void setUp() throws Exception {
factory = new DuoSDKClientFactory();
diff --git a/idp-duo-nimbus-client-impl/pom.xml b/idp-duo-nimbus-client-impl/pom.xml
index 39eb311..7650cfb 100644
--- a/idp-duo-nimbus-client-impl/pom.xml
+++ b/idp-duo-nimbus-client-impl/pom.xml
@@ -27,6 +27,7 @@
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>9.0</version>
+ <scope>compile</scope>
</dependency>
<!-- provided dependencies -->
@@ -41,23 +42,15 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpcore</artifactId>
<scope>provided</scope>
</dependency>
+
+ <!-- Needed for module/plugin impls. -->
<dependency>
- <groupId>com.fasterxml.jackson.datatype</groupId>
- <artifactId>jackson-datatype-jsr310</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency> <!-- required for the DuoIntegration -->
<groupId>${idp.groupId}</groupId>
- <artifactId>idp-authn-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
+ <artifactId>idp-admin-impl</artifactId>
<scope>provided</scope>
</dependency>
<!-- Test dependencies -->
@@ -71,7 +64,7 @@
<artifactId>idp-profile-spring</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<scope>test</scope>
diff --git a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/DuoHttpClientFactoryBean.java b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/DuoOIDCNimbusModule.java
similarity index 62%
copy from idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/DuoHttpClientFactoryBean.java
copy to idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/DuoOIDCNimbusModule.java
index 44b5149..939782c 100644
--- a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/DuoHttpClientFactoryBean.java
+++ b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/DuoOIDCNimbusModule.java
@@ -15,21 +15,26 @@
* limitations under the License.
*/
-
package net.shibboleth.idp.plugin.authn.duo.nimbus;
-import net.shibboleth.idp.plugin.authn.duo.Version;
+import java.io.IOException;
+
+import net.shibboleth.idp.module.ModuleException;
+import net.shibboleth.idp.module.impl.PluginIdPModule;
/**
- * Factory bean customization for the Duo plugin. Uses the plugin product name and version inside the user_agent string.
+ * {@link PluginIdPModule} implementation using only Nimbus OIDC/JWT handling.
*/
-public class DuoHttpClientFactoryBean extends net.shibboleth.ext.spring.factory.HttpClientFactoryBean {
+public class DuoOIDCNimbusModule extends PluginIdPModule {
- /** Constructor. */
- public DuoHttpClientFactoryBean() {
- final StringBuilder stringBuilder = new StringBuilder("ShibbolethIdPDuoPlugin/");
- stringBuilder.append(Version.getVersion());
- setUserAgent(stringBuilder.toString());
+ /**
+ * Constructor.
+ *
+ * @throws IOException if the property file cannot be loaded
+ * @throws ModuleException if other errors occur
+ */
+ public DuoOIDCNimbusModule() throws IOException, ModuleException {
+ super(DuoOIDCNimbusModule.class);
}
-
-}
+
+}
\ No newline at end of file
diff --git a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/DuoOIDCPlugin.java b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/DuoOIDCNimbusPlugin.java
similarity index 73%
rename from idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/DuoOIDCPlugin.java
rename to idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/DuoOIDCNimbusPlugin.java
index b2273ab..2f79bce 100644
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/DuoOIDCPlugin.java
+++ b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/DuoOIDCNimbusPlugin.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.plugin.authn.duo;
+package net.shibboleth.idp.plugin.authn.duo.nimbus;
import java.io.IOException;
import java.util.Collections;
@@ -26,16 +26,21 @@ import net.shibboleth.idp.plugin.PluginException;
import net.shibboleth.idp.plugin.impl.FirstPartyIdPPlugin;
/**
- * Details about the Duo OIDC 2FA plugin.
+ * Details about the Duo OIDC 2FA plugin using only Nimbus OIDC/JWT handling.
*/
-public class DuoOIDCPlugin extends FirstPartyIdPPlugin{
+public class DuoOIDCNimbusPlugin extends FirstPartyIdPPlugin{
- /** Constructor.*/
- public DuoOIDCPlugin() throws IOException, PluginException{
- super(DuoOIDCPlugin.class);
+ /**
+ * Constructor.
+ *
+ * @throws IOException if the properties fail to load
+ * @throws PluginException if other errors occur
+ */
+ public DuoOIDCNimbusPlugin() throws IOException, PluginException{
+ super(DuoOIDCNimbusPlugin.class);
try {
- final IdPModule module = new DuoOIDCModule();
+ final IdPModule module = new DuoOIDCNimbusModule();
setEnableOnInstall(Collections.singleton(module));
setDisableOnRemoval(Collections.singleton(module));
} catch (final IOException e) {
diff --git a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/DuoHttpClientFactoryBean.java b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/DuoHttpClientFactoryBean.java
similarity index 96%
rename from idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/DuoHttpClientFactoryBean.java
rename to idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/DuoHttpClientFactoryBean.java
index 44b5149..e59cd2b 100644
--- a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/DuoHttpClientFactoryBean.java
+++ b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/DuoHttpClientFactoryBean.java
@@ -16,7 +16,7 @@
*/
-package net.shibboleth.idp.plugin.authn.duo.nimbus;
+package net.shibboleth.idp.plugin.authn.duo.nimbus.impl;
import net.shibboleth.idp.plugin.authn.duo.Version;
diff --git a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClient.java b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClient.java
similarity index 97%
rename from idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClient.java
rename to idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClient.java
index 999305f..c3124b1 100644
--- a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClient.java
+++ b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClient.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.plugin.authn.duo.nimbus;
+package net.shibboleth.idp.plugin.authn.duo.nimbus.impl;
import java.io.IOException;
import java.net.URI;
@@ -38,10 +38,8 @@ import org.opensaml.security.httpclient.HttpClientSecuritySupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.nimbusds.jose.JWSObject;
import com.nimbusds.jose.util.IOUtils;
import com.nimbusds.jwt.JWT;
import com.nimbusds.jwt.SignedJWT;
@@ -81,7 +79,7 @@ final class NimbusClient implements DuoOIDCClient{
@Nonnull private ObjectMapper objectMapper;
/** The client instance UUID.*/
- @Nonnull private final String clientId;
+ @Nonnull @NotEmpty private final String clientId;
/**
* Constructor.
@@ -154,7 +152,7 @@ final class NimbusClient implements DuoOIDCClient{
/** {@inheritDoc} */
@Override
- public SignedJWT exchangeAuthorizationCodeFor2FAResult(@Nonnull final String code,
+ public JWT exchangeAuthorizationCodeFor2FAResult(@Nonnull final String code,
@Nonnull final String username) throws DuoClientException {
Constraint.isNotEmpty(code, "Auth_code can not be null");
diff --git a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientFactory.java b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientFactory.java
similarity index 98%
rename from idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientFactory.java
rename to idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientFactory.java
index 2cdf6dc..fe76c85 100644
--- a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientFactory.java
+++ b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientFactory.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.plugin.authn.duo.nimbus;
+package net.shibboleth.idp.plugin.authn.duo.nimbus.impl;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
diff --git a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientSupport.java b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientSupport.java
similarity index 97%
rename from idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientSupport.java
rename to idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientSupport.java
index b7cdecb..61ec9d1 100644
--- a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientSupport.java
+++ b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientSupport.java
@@ -16,7 +16,7 @@
*/
-package net.shibboleth.idp.plugin.authn.duo.nimbus;
+package net.shibboleth.idp.plugin.authn.duo.nimbus.impl;
import java.nio.charset.StandardCharsets;
import java.security.SecureRandom;
@@ -81,6 +81,8 @@ public final class NimbusClientSupport {
* @param state the state
* @param username the subject of the authentication
*
+ * @throws DuoClientException on error constructing the JWS request object
+ *
* @return a signed JWT
*/
//TODO this method and the below should be nimbus, inside oidc-commons, and merged into a single API
@@ -122,6 +124,8 @@ public final class NimbusClientSupport {
* @param aud the audience of the JWT.
* @param duoIntegration the integration used to construct the JWT.
*
+ * @throws DuoClientException on error constructing the JWS object
+ *
* @return a signed JWT.
*
*/
diff --git a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/TokenResponse.java b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/TokenResponse.java
similarity index 99%
rename from idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/TokenResponse.java
rename to idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/TokenResponse.java
index 2476dc8..213fcc7 100644
--- a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/TokenResponse.java
+++ b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/TokenResponse.java
@@ -32,7 +32,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.plugin.authn.duo.nimbus;
+package net.shibboleth.idp.plugin.authn.duo.nimbus.impl;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
diff --git a/idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/package-info.java b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/package-info.java
similarity index 86%
copy from idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/package-info.java
copy to idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/package-info.java
index b84a17a..6118d0a 100644
--- a/idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/package-info.java
+++ b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/package-info.java
@@ -15,5 +15,5 @@
* limitations under the License.
*/
-/** Native Duo OIDC 2FA client adaptor implementation classes. */
-package net.shibboleth.idp.plugin.authn.duo.sdk.impl;
+/** Native Nimbus based Duo OIDC 2FA client adaptor implementation classes. */
+package net.shibboleth.idp.plugin.authn.duo.nimbus.impl;
diff --git a/idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/package-info.java b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/package-info.java
similarity index 87%
copy from idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/package-info.java
copy to idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/package-info.java
index b84a17a..fa4b833 100644
--- a/idp-duo-native-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/package-info.java
+++ b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/package-info.java
@@ -15,5 +15,5 @@
* limitations under the License.
*/
-/** Native Duo OIDC 2FA client adaptor implementation classes. */
-package net.shibboleth.idp.plugin.authn.duo.sdk.impl;
+/** Native Nimbus based Duo OIDC integration plugin. */
+package net.shibboleth.idp.plugin.authn.duo.nimbus;
diff --git a/idp-duo-nimbus-client-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule b/idp-duo-nimbus-client-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule
new file mode 100644
index 0000000..19d6480
--- /dev/null
+++ b/idp-duo-nimbus-client-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule
@@ -0,0 +1 @@
+net.shibboleth.idp.plugin.authn.duo.nimbus.DuoOIDCNimbusModule
diff --git a/idp-duo-nimbus-client-impl/src/main/resources/META-INF/services/net.shibboleth.idp.plugin.IdPPlugin b/idp-duo-nimbus-client-impl/src/main/resources/META-INF/services/net.shibboleth.idp.plugin.IdPPlugin
new file mode 100644
index 0000000..c351e65
--- /dev/null
+++ b/idp-duo-nimbus-client-impl/src/main/resources/META-INF/services/net.shibboleth.idp.plugin.IdPPlugin
@@ -0,0 +1 @@
+net.shibboleth.idp.plugin.authn.duo.nimbus.DuoOIDCNimbusPlugin
diff --git a/idp-duo-nimbus-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/duo-client-factory-bean.xml b/idp-duo-nimbus-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/duo-client-factory-bean.xml
index dd1fd36..cacbf6e 100644
--- a/idp-duo-nimbus-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/duo-client-factory-bean.xml
+++ b/idp-duo-nimbus-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/duo-client-factory-bean.xml
@@ -10,7 +10,7 @@
default-init-method="initialize" default-destroy-method="destroy">
<bean id="shibboleth.authn.DuoOIDC.nimbus.clientFactory"
- class="net.shibboleth.idp.plugin.authn.duo.nimbus.NimbusClientFactory" scope="singleton"
+ class="net.shibboleth.idp.plugin.authn.duo.nimbus.impl.NimbusClientFactory" scope="singleton"
p:httpClient="#{getObject('shibboleth.authn.DuoOIDC.HttpClient') ?: getObject('shibboleth.authn.DuoOIDC.InternalHttpClient')}"
p:httpClientSecurityParameters="#{getObject('shibboleth.authn.DuoOIDC.HttpClientSecurityParameters')}"
p:objectMapper-ref="shibboleth.authn.DuoOIDC.JSONObjectMapper">
@@ -19,7 +19,7 @@
<!-- Create a default HTTP Client with the option to override the settings -->
<bean id="shibboleth.authn.DuoOIDC.InternalHttpClient"
- class="net.shibboleth.idp.plugin.authn.duo.nimbus.DuoHttpClientFactoryBean" lazy-init="true"
+ class="net.shibboleth.idp.plugin.authn.duo.nimbus.impl.DuoHttpClientFactoryBean" lazy-init="true"
p:tLSSocketFactory-ref="shibboleth.SecurityEnhancedTLSSocketFactory"
p:connectionDisregardTLSCertificate="%{idp.duo.oidc.connectionDisregardTLSCertificate:false}"
p:connectionTimeout="%{idp.duo.oidc.connectionTimeout:%{idp.httpclient.connectionTimeout:PT1M}}"
diff --git a/idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/module/conf/authn/duo-oidc-authn-config.xml b/idp-duo-nimbus-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/nimbus/conf/authn/duo-oidc-authn-config.xml
similarity index 100%
rename from idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/module/conf/authn/duo-oidc-authn-config.xml
rename to idp-duo-nimbus-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/nimbus/conf/authn/duo-oidc-authn-config.xml
diff --git a/idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/module/conf/authn/duo-oidc.properties b/idp-duo-nimbus-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/nimbus/conf/authn/duo-oidc.properties
similarity index 93%
rename from idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/module/conf/authn/duo-oidc.properties
rename to idp-duo-nimbus-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/nimbus/conf/authn/duo-oidc.properties
index d470342..4b90f32 100644
--- a/idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/module/conf/authn/duo-oidc.properties
+++ b/idp-duo-nimbus-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/nimbus/conf/authn/duo-oidc.properties
@@ -16,7 +16,7 @@ idp.duo.oidc.redirectURL = https://something
# Controls the "back-end" OIDC implementation.
# shibboleth.authn.DuoOIDC.native.sdk.clientFactory (Duo WebSDK-based)
# shibboleth.authn.DuoOIDC.nimbus.clientFactory (Shibboleth Nimbus-based)
-#idp.duo.oidc.clientFactoryBean = shibboleth.authn.DuoOIDC.native.sdk.clientFactory
+idp.duo.oidc.clientFactoryBean = shibboleth.authn.DuoOIDC.nimbus.clientFactory
# With the Nimbus "client" impl, controls for HttpClient behavior
# These default to the global HttpClient options in services.properties
diff --git a/idp-duo-nimbus-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/nimbus/module.properties b/idp-duo-nimbus-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/nimbus/module.properties
new file mode 100644
index 0000000..189df6a
--- /dev/null
+++ b/idp-duo-nimbus-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/nimbus/module.properties
@@ -0,0 +1,12 @@
+# Properties defining plugin module(s)
+
+# Class to Module ID mappings
+net.shibboleth.idp.plugin.authn.duo.nimbus.DuoOIDCNimbusModule = idp.authn.DuoOIDC
+
+idp.authn.Duo.name = Duo "Universal Prompt" OIDC-based Authentication
+idp.authn.Duo.desc = Login flow for Duo Security's second-factor authentication service using the OIDC-based Universal Prompt via native OIDC libraries
+idp.authn.Duo.url = /DuoOIDCAuthnConfiguration
+idp.authn.Duo.1.src = /net/shibboleth/idp/plugin/authn/duo/nimbus/conf/authn/duo-oidc-authn-config.xml
+idp.authn.Duo.1.dest = conf/authn/duo-oidc-authn-config.xml
+idp.authn.Duo.2.src = /net/shibboleth/idp/plugin/authn/duo/nimbus/conf/authn/duo-oidc.properties
+idp.authn.Duo.2.dest = conf/authn/duo-oidc.properties
diff --git a/idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/plugin.properties b/idp-duo-nimbus-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/nimbus/plugin.properties
similarity index 73%
rename from idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/plugin.properties
rename to idp-duo-nimbus-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/nimbus/plugin.properties
index ccd69b4..9cf5101 100644
--- a/idp-duo-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/plugin.properties
+++ b/idp-duo-nimbus-client-impl/src/main/resources/net/shibboleth/idp/plugin/authn/duo/nimbus/plugin.properties
@@ -1,6 +1,6 @@
# Properties defining this plugin
-plugin.id = net.shibboleth.idp.plugin.authn.duo
+plugin.id = net.shibboleth.idp.plugin.authn.duo.nimbus
# Only used when package manifest is not available
plugin.version = 1.0.0
diff --git a/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/.gitignore b/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/.gitignore
similarity index 100%
rename from idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/.gitignore
rename to idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/.gitignore
diff --git a/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientFactoryTest.java b/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientFactoryTest.java
similarity index 95%
rename from idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientFactoryTest.java
rename to idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientFactoryTest.java
index da27ab0..1a3c1eb 100644
--- a/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientFactoryTest.java
+++ b/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientFactoryTest.java
@@ -1,5 +1,5 @@
-package net.shibboleth.idp.plugin.authn.duo.nimbus;
+package net.shibboleth.idp.plugin.authn.duo.nimbus.impl;
import static org.testng.Assert.assertNotNull;
@@ -15,6 +15,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import net.shibboleth.idp.plugin.authn.duo.DefaultDuoOIDCIntegration;
import net.shibboleth.idp.plugin.authn.duo.DuoClientException;
import net.shibboleth.idp.plugin.authn.duo.DuoOIDCClient;
+import net.shibboleth.idp.plugin.authn.duo.nimbus.impl.NimbusClientFactory;
import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
diff --git a/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientSupportTest.java b/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientSupportTest.java
similarity index 95%
rename from idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientSupportTest.java
rename to idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientSupportTest.java
index c6b57f7..b4f6ef5 100644
--- a/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientSupportTest.java
+++ b/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientSupportTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.plugin.authn.duo.nimbus;
+package net.shibboleth.idp.plugin.authn.duo.nimbus.impl;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
@@ -30,6 +30,7 @@ import org.testng.annotations.Test;
import net.shibboleth.idp.plugin.authn.duo.DefaultDuoOIDCIntegration;
import net.shibboleth.idp.plugin.authn.duo.DuoClientException;
+import net.shibboleth.idp.plugin.authn.duo.nimbus.impl.NimbusClientSupport;
/** Tests for the NimbusClientSupport class.*/
public class NimbusClientSupportTest {
diff --git a/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientTest.java b/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientTest.java
similarity index 99%
rename from idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientTest.java
rename to idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientTest.java
index b4f5056..f5a8392 100644
--- a/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/NimbusClientTest.java
+++ b/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientTest.java
@@ -34,7 +34,7 @@
*/
-package net.shibboleth.idp.plugin.authn.duo.nimbus;
+package net.shibboleth.idp.plugin.authn.duo.nimbus.impl;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
@@ -62,6 +62,7 @@ import com.nimbusds.jwt.JWT;
import net.shibboleth.idp.plugin.authn.duo.DefaultDuoOIDCIntegration;
import net.shibboleth.idp.plugin.authn.duo.DuoClientException;
import net.shibboleth.idp.plugin.authn.duo.model.DuoHealthCheck;
+import net.shibboleth.idp.plugin.authn.duo.nimbus.impl.NimbusClient;
import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
/** Tests for the NimbusClient class.*/
diff --git a/pom.xml b/pom.xml
index 83bcd6c..307389d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -79,21 +79,14 @@
<scope>test</scope>
</dependency>
- <!-- TODO REMOVE -->
-
+ <!-- review this dep when we move to central oidc-commons-lib -->
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>9.0</version>
</dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.datatype</groupId>
- <artifactId>jackson-datatype-jsr310</artifactId>
- </dependency>
+
+
</dependencies>
<dependencyManagement>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list