[java-idp-plugin-duo] branch main updated: JDUO-72 - Remove DuoWeb dependency if possible
Scott Cantor
cantor.2 at osu.edu
Tue Jul 18 17:15:09 UTC 2023
This is an automated email from the git hooks/post-receive script.
scantor 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=fb65aa34c8bb0c8de42d5012078873b5e1153631
The following commit(s) were added to refs/heads/main by this push:
new fb65aa3 JDUO-72 - Remove DuoWeb dependency if possible
fb65aa3 is described below
commit fb65aa34c8bb0c8de42d5012078873b5e1153631
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Jul 18 13:15:06 2023 -0400
JDUO-72 - Remove DuoWeb dependency if possible
https://shibboleth.atlassian.net/browse/JDUO-72
Remediate dependencies on the old Duo SDK.
Inline HMAC for now.
Fix up checkstyle.
---
idp-duo-api/.checkstyle | 10 ++++++
idp-duo-impl/.checkstyle | 9 ++++--
idp-duo-impl/pom.xml | 5 ---
.../authn/duo/impl/AbstractDuoAuthenticator.java | 12 ++++----
.../authn/duo/impl/DuoAuthAuthenticator.java | 16 +++++-----
.../authn/duo/impl/DuoPreauthAuthenticator.java | 15 +++++----
.../idp/plugin/authn/duo/impl/DuoSupport.java | 36 ++++++++++++----------
.../plugin/authn/duo/impl/ValidateDuoAuthAPI.java | 11 +++----
idp-duo-nimbus-client-impl/.checkstyle | 10 ++++++
.../authn/duo/nimbus/impl/TokenResponse.java | 16 +++++-----
idp-duo-sdk-client-impl/.checkstyle | 10 ++++++
.../authn/duo/sdk/impl/DuoSDKClientAdaptor.java | 3 +-
.../checkstyle/checkstyle.xml | 0
13 files changed, 94 insertions(+), 59 deletions(-)
diff --git a/idp-duo-api/.checkstyle b/idp-duo-api/.checkstyle
new file mode 100644
index 0000000..ddc9157
--- /dev/null
+++ b/idp-duo-api/.checkstyle
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="false" sync-formatter="false">
+ <local-check-config name="Shibboleth Checkstyle" location="/java-idp-plugin-duo/resources/checkstyle/checkstyle.xml" type="project" description="">
+ <additional-data name="protect-config-file" value="false"/>
+ </local-check-config>
+ <fileset name="main" enabled="true" check-config-name="Shibboleth Checkstyle" local="true">
+ <file-match-pattern match-pattern="src/main/java/.*\.java$" include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/idp-duo-impl/.checkstyle b/idp-duo-impl/.checkstyle
index 162e469..ddc9157 100644
--- a/idp-duo-impl/.checkstyle
+++ b/idp-duo-impl/.checkstyle
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
-<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
- <fileset name="all" enabled="true" check-config-name="shibboleth" local="false">
- <file-match-pattern match-pattern="." include-pattern="true"/>
+<fileset-config file-format-version="1.2.0" simple-config="false" sync-formatter="false">
+ <local-check-config name="Shibboleth Checkstyle" location="/java-idp-plugin-duo/resources/checkstyle/checkstyle.xml" type="project" description="">
+ <additional-data name="protect-config-file" value="false"/>
+ </local-check-config>
+ <fileset name="main" enabled="true" check-config-name="Shibboleth Checkstyle" local="true">
+ <file-match-pattern match-pattern="src/main/java/.*\.java$" include-pattern="true"/>
</fileset>
</fileset-config>
diff --git a/idp-duo-impl/pom.xml b/idp-duo-impl/pom.xml
index b71f532..01633ed 100644
--- a/idp-duo-impl/pom.xml
+++ b/idp-duo-impl/pom.xml
@@ -27,11 +27,6 @@
<artifactId>idp-plugin-duo-api</artifactId>
</dependency>
- <dependency>
- <groupId>com.duosecurity</groupId>
- <artifactId>DuoWeb</artifactId>
- </dependency>
-
<!-- Provided dependencies -->
<dependency>
<groupId>net.shibboleth.oidc</groupId>
diff --git a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/AbstractDuoAuthenticator.java b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/AbstractDuoAuthenticator.java
index 988fcc5..a4665cb 100644
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/AbstractDuoAuthenticator.java
+++ b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/AbstractDuoAuthenticator.java
@@ -32,10 +32,10 @@ import org.apache.hc.core5.http.HttpStatus;
import org.opensaml.security.httpclient.HttpClientSecurityParameters;
import org.opensaml.security.httpclient.HttpClientSecuritySupport;
-import com.duosecurity.duoweb.DuoWebException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
+import net.shibboleth.idp.plugin.authn.duo.DuoException;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.component.AbstractInitializableComponent;
import net.shibboleth.shared.component.ComponentInitializationException;
@@ -111,11 +111,11 @@ public abstract class AbstractDuoAuthenticator extends AbstractInitializableComp
* @return a {@link DuoResponseWrapper}
*
* @throws IOException on an I/O error
- * @throws DuoWebException on a Duo-related error
+ * @throws DuoException on a Duo-related error
*/
protected <T extends DuoResponseWrapper<?>> T doAPIRequest(@Nonnull final ClassicHttpRequest request,
@Nonnull final TypeReference<T> wrapperTypeRef)
- throws DuoWebException, IOException {
+ throws DuoException, IOException {
// Make the request.
final HttpClientContext clientContext = HttpClientContext.create();
@@ -137,7 +137,7 @@ public abstract class AbstractDuoAuthenticator extends AbstractInitializableComp
.append(" (")
.append(msg.getMessageDetail() != null ? msg.getMessageDetail() : "no detail")
.append(")");
- throw new DuoWebException(builder.toString());
+ throw new DuoException(builder.toString());
}
if (httpStatusCode != HttpStatus.SC_OK) {
throw new IOException("Non-ok status code (" + httpStatusCode + ") returned from Duo: "
@@ -150,9 +150,9 @@ public abstract class AbstractDuoAuthenticator extends AbstractInitializableComp
final T duoResponse = objectMapper.readValue(httpResponse.getEntity().getContent(), wrapperTypeRef);
if (duoResponse == null) {
- throw new DuoWebException("Unable to parse JSON response");
+ throw new DuoException("Unable to parse JSON response");
} else if (!"OK".equals(duoResponse.getStat())) {
- throw new DuoWebException("Unexpected status value in JSON response: " + duoResponse.getStat());
+ throw new DuoException("Unexpected status value in JSON response: " + duoResponse.getStat());
}
return duoResponse;
diff --git a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoAuthAuthenticator.java b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoAuthAuthenticator.java
index b1cc280..3d99e46 100644
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoAuthAuthenticator.java
+++ b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoAuthAuthenticator.java
@@ -31,7 +31,6 @@ import org.apache.hc.core5.http.ClassicHttpRequest;
import org.apache.hc.core5.http.io.support.ClassicRequestBuilder;
import org.apache.hc.core5.net.URIBuilder;
-import com.duosecurity.duoweb.DuoWebException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.google.common.escape.Escaper;
import com.google.common.net.UrlEscapers;
@@ -39,6 +38,8 @@ import com.google.common.net.UrlEscapers;
import net.shibboleth.idp.authn.duo.DuoAuthAPI;
import net.shibboleth.idp.authn.duo.DuoIntegration;
import net.shibboleth.idp.authn.duo.context.DuoAuthenticationContext;
+import net.shibboleth.idp.plugin.authn.duo.DuoException;
+import net.shibboleth.shared.codec.EncodingException;
import net.shibboleth.shared.primitive.StringSupport;
/**
@@ -53,7 +54,6 @@ public class DuoAuthAuthenticator extends AbstractDuoAuthenticator {
@Nonnull private final TypeReference<DuoResponseWrapper<DuoAuthResponse>> wrapperTypeRef;
/** Constructor. */
- @SuppressWarnings("null")
public DuoAuthAuthenticator() {
wrapperTypeRef = new TypeReference<>() {};
paramEscaper = UrlEscapers.urlFormParameterEscaper();
@@ -67,17 +67,18 @@ public class DuoAuthAuthenticator extends AbstractDuoAuthenticator {
*
* @return a {@link DuoAuthResponse}
*
- * @throws DuoWebException if an error occurs
+ * @throws DuoException if an error occurs
*/
public DuoAuthResponse authenticate(@Nonnull final DuoAuthenticationContext duoContext,
- @Nonnull final DuoIntegration duoIntegration) throws DuoWebException {
+ @Nonnull final DuoIntegration duoIntegration) throws DuoException {
try {
// prepare the request
final URI uri = new URIBuilder().setScheme("https").setHost(duoIntegration.getAPIHost())
.setPath("/auth/v2/auth").build();
final ClassicRequestBuilder rb =
- ClassicRequestBuilder.post().setUri(uri).addParameter(DuoAuthAPI.DUO_USERNAME, duoContext.getUsername());
+ ClassicRequestBuilder.post().setUri(uri).addParameter(DuoAuthAPI.DUO_USERNAME,
+ duoContext.getUsername());
assert rb != null;
if (duoContext.getClientAddress() != null) {
rb.addParameter(DuoAuthAPI.DUO_IPADDR, duoContext.getClientAddress());
@@ -104,8 +105,9 @@ public class DuoAuthAuthenticator extends AbstractDuoAuthenticator {
// do it
return doAPIRequest(request, wrapperTypeRef).getResponse();
- } catch (final IOException | URISyntaxException | InvalidKeyException | NoSuchAlgorithmException ex) {
- throw new DuoWebException("Duo AuthAPI auth request failed: " + ex.getMessage());
+ } catch (final IOException | URISyntaxException | InvalidKeyException | NoSuchAlgorithmException |
+ EncodingException ex) {
+ throw new DuoException("Duo AuthAPI auth request failed: " + ex.getMessage());
}
}
diff --git a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoPreauthAuthenticator.java b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoPreauthAuthenticator.java
index f31f790..922e394 100644
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoPreauthAuthenticator.java
+++ b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoPreauthAuthenticator.java
@@ -29,12 +29,13 @@ import org.apache.hc.core5.http.ClassicHttpRequest;
import org.apache.hc.core5.http.io.support.ClassicRequestBuilder;
import org.apache.hc.core5.net.URIBuilder;
-import com.duosecurity.duoweb.DuoWebException;
import com.fasterxml.jackson.core.type.TypeReference;
import net.shibboleth.idp.authn.duo.DuoAuthAPI;
import net.shibboleth.idp.authn.duo.DuoIntegration;
import net.shibboleth.idp.authn.duo.context.DuoAuthenticationContext;
+import net.shibboleth.idp.plugin.authn.duo.DuoException;
+import net.shibboleth.shared.codec.EncodingException;
@@ -59,16 +60,17 @@ public class DuoPreauthAuthenticator extends AbstractDuoAuthenticator {
*
* @return a {@link DuoPreauthResponse}
*
- * @throws DuoWebException if an error occurs
+ * @throws DuoException if an error occurs
*/
public DuoPreauthResponse authenticate(@Nonnull final DuoAuthenticationContext duoContext,
- @Nonnull final DuoIntegration duoIntegration) throws DuoWebException {
+ @Nonnull final DuoIntegration duoIntegration) throws DuoException {
try {
// Prepare the request
final URI uri = new URIBuilder().setScheme("https").setHost(duoIntegration.getAPIHost())
.setPath("/auth/v2/preauth").build();
final ClassicRequestBuilder rb =
- ClassicRequestBuilder.post().setUri(uri).addParameter(DuoAuthAPI.DUO_USERNAME, duoContext.getUsername());
+ ClassicRequestBuilder.post().setUri(uri).addParameter(DuoAuthAPI.DUO_USERNAME,
+ duoContext.getUsername());
if (duoContext.getClientAddress() != null) {
rb.addParameter(DuoAuthAPI.DUO_IPADDR, duoContext.getClientAddress());
@@ -78,8 +80,9 @@ public class DuoPreauthAuthenticator extends AbstractDuoAuthenticator {
final ClassicHttpRequest request = rb.build();
return doAPIRequest(request, wrapperTypeRef).getResponse();
- } catch (final IOException | URISyntaxException | InvalidKeyException | NoSuchAlgorithmException ex) {
- throw new DuoWebException("Duo AuthAPI preauth request failed: " + ex.getMessage());
+ } catch (final IOException | URISyntaxException | InvalidKeyException | NoSuchAlgorithmException |
+ EncodingException ex) {
+ throw new DuoException("Duo AuthAPI preauth request failed: " + ex.getMessage());
}
}
diff --git a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoSupport.java b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoSupport.java
index 1bde4cf..0b21902 100644
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoSupport.java
+++ b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoSupport.java
@@ -17,7 +17,6 @@
package net.shibboleth.idp.plugin.authn.duo.impl;
-import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
@@ -31,20 +30,22 @@ import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.concurrent.ThreadSafe;
+import javax.crypto.Mac;
+import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
import org.apache.hc.core5.http.NameValuePair;
import org.apache.hc.core5.http.io.support.ClassicRequestBuilder;
-import com.duosecurity.duoweb.Base64;
-import com.duosecurity.duoweb.Util;
import com.google.common.escape.Escaper;
import com.google.common.net.UrlEscapers;
import net.shibboleth.idp.authn.duo.DuoIntegration;
import net.shibboleth.idp.plugin.authn.duo.DuoException;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
+import net.shibboleth.shared.codec.Base64Support;
+import net.shibboleth.shared.codec.EncodingException;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.StringSupport;
@@ -53,8 +54,8 @@ import net.shibboleth.shared.primitive.StringSupport;
*/
@ThreadSafe
public final class DuoSupport {
-
- /** RFC 2822 formatter for date/time. */
+
+ /** RFC 2822 formatter for date/time. */
public static final DateTimeFormatter RFC_2822_DATE_FORMAT;
static {
@@ -75,12 +76,10 @@ public final class DuoSupport {
*
* @return the parameters to be signed in their canonical order
*
- * @throws UnsupportedEncodingException failure from {@link java.net.URLEncoder}
- *
* @since 2.0.0
*/
private static String canonRequest(@Nonnull final ClassicRequestBuilder request, @Nonnull final String date,
- final int sigVersion) throws UnsupportedEncodingException {
+ final int sigVersion) {
final URI uri = request.getUri();
String canon = "";
if (sigVersion == 2) {
@@ -104,12 +103,9 @@ public final class DuoSupport {
*
* @return the canonical query string
*
- * @throws UnsupportedEncodingException failure from {@link java.net.URLEncoder}
- *
* @since 2.0.0
*/
- private static String createQueryString(@Nonnull final List<NameValuePair> params)
- throws UnsupportedEncodingException {
+ private static String createQueryString(@Nonnull final List<NameValuePair> params) {
final ArrayList<String> args = new ArrayList<>();
@@ -142,23 +138,29 @@ public final class DuoSupport {
*
* @throws InvalidKeyException bad skey value
* @throws NoSuchAlgorithmException unknown encryption algorithm
- * @throws UnsupportedEncodingException failure from {@link java.net.URLEncoder}
+ * @throws EncodingException if unable to base64-encode the header
*
* @since 2.0.0
*/
@NotEmpty public static void signRequest(@Nonnull final ClassicRequestBuilder request,
- @Nonnull final DuoIntegration duo)
- throws InvalidKeyException, NoSuchAlgorithmException, UnsupportedEncodingException {
+ @Nonnull final DuoIntegration duo) throws InvalidKeyException, NoSuchAlgorithmException, EncodingException {
+
final String ikey = duo.getIntegrationKey();
final String skey = duo.getSecretKey();
final int sigVersion = 2;
final String date = RFC_2822_DATE_FORMAT.format(ZonedDateTime.now());
assert date != null;
final String canon = canonRequest(request, date, sigVersion);
- final String sig = Util.hmacSign(skey, canon);
+
+ // Inlined HMAC code from DuoWeb:
+ final SecretKeySpec key = new SecretKeySpec(skey.getBytes(), "HmacSHA1");
+ final Mac mac = Mac.getInstance("HmacSHA1");
+ mac.init(key);
+ final byte[] raw = mac.doFinal(canon.getBytes());
+ final String sig = Hex.encodeHexString(raw);
final String auth = ikey + ":" + sig;
- final String header = "Basic " + Base64.encodeBytes(auth.getBytes());
+ final String header = "Basic " + Base64Support.encode(auth.getBytes(), false);
request.addHeader("Authorization", header);
request.addHeader("Date", date);
}
diff --git a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateDuoAuthAPI.java b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateDuoAuthAPI.java
index 3e13c14..435b72e 100644
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateDuoAuthAPI.java
+++ b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateDuoAuthAPI.java
@@ -33,8 +33,6 @@ import org.opensaml.profile.action.EventIds;
import org.opensaml.profile.context.ProfileRequestContext;
import org.slf4j.Logger;
-import com.duosecurity.duoweb.DuoWebException;
-
import net.shibboleth.idp.authn.AbstractValidationAction;
import net.shibboleth.idp.authn.AuthnAuditFields;
import net.shibboleth.idp.authn.AuthnEventIds;
@@ -45,6 +43,7 @@ import net.shibboleth.idp.authn.duo.DuoIntegration;
import net.shibboleth.idp.authn.duo.DuoPrincipal;
import net.shibboleth.idp.authn.duo.context.DuoAuthenticationContext;
import net.shibboleth.idp.authn.impl.AbstractAuditingValidationAction;
+import net.shibboleth.idp.plugin.authn.duo.DuoException;
import net.shibboleth.idp.profile.IdPAuditFields;
import net.shibboleth.idp.session.context.navigate.CanonicalUsernameLookupStrategy;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
@@ -238,7 +237,7 @@ public class ValidateDuoAuthAPI extends AbstractAuditingValidationAction {
final DuoPreauthResponse preAuthResponse = preauthAuthenticator.authenticate(duoContext, duoIntegration);
if (preAuthResponse == null) {
log.info("{} No Duo AuthAPI preauthentication response", getLogPrefix());
- throw new DuoWebException("No preauthentication response");
+ throw new DuoException("No preauthentication response");
}
final String preAuthResult = preAuthResponse.getResult();
@@ -293,7 +292,7 @@ public class ValidateDuoAuthAPI extends AbstractAuditingValidationAction {
final DuoAuthResponse authenticationResponse = authAuthenticator.authenticate(duoContext, duoIntegration);
if (authenticationResponse == null) {
log.info("{} No Duo AuthAPI authentication response", getLogPrefix());
- throw new DuoWebException("No authentication response");
+ throw new DuoException("No authentication response");
}
final String authResult = authenticationResponse.getResult();
@@ -308,9 +307,9 @@ public class ValidateDuoAuthAPI extends AbstractAuditingValidationAction {
AuthnEventIds.INVALID_CREDENTIALS);
recordFailure(profileRequestContext);
} else {
- throw new DuoWebException("Unexpected authentication response");
+ throw new DuoException("Unexpected authentication response");
}
- } catch (final DuoWebException e) {
+ } catch (final DuoException e) {
log.error("{} Duo AuthAPI access failed for '{}'", getLogPrefix(), username, e);
handleError(profileRequestContext, authenticationContext, e, AuthnEventIds.AUTHN_EXCEPTION);
recordFailure(profileRequestContext);
diff --git a/idp-duo-nimbus-client-impl/.checkstyle b/idp-duo-nimbus-client-impl/.checkstyle
new file mode 100644
index 0000000..ddc9157
--- /dev/null
+++ b/idp-duo-nimbus-client-impl/.checkstyle
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="false" sync-formatter="false">
+ <local-check-config name="Shibboleth Checkstyle" location="/java-idp-plugin-duo/resources/checkstyle/checkstyle.xml" type="project" description="">
+ <additional-data name="protect-config-file" value="false"/>
+ </local-check-config>
+ <fileset name="main" enabled="true" check-config-name="Shibboleth Checkstyle" local="true">
+ <file-match-pattern match-pattern="src/main/java/.*\.java$" include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/TokenResponse.java b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/TokenResponse.java
index 75e04f7..a7813af 100644
--- a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/TokenResponse.java
+++ b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/TokenResponse.java
@@ -166,7 +166,7 @@ public final class TokenResponse {
*
* @return the next stage
*/
- public IAccessTokenStage withIdToken(final String idToken);
+ IAccessTokenStage withIdToken(final String idToken);
}
/** Access token stage interface.*/
@@ -179,7 +179,7 @@ public final class TokenResponse {
*
* @return the next stage
*/
- public ITokenTypeStage withAccessToken(final String accessToken);
+ ITokenTypeStage withAccessToken(final String accessToken);
}
/** Token type stage interface.*/
@@ -192,20 +192,20 @@ public final class TokenResponse {
*
* @return the next stage
*/
- public IBuildStage withTokenType(final String tokenType);
+ IBuildStage withTokenType(final String tokenType);
}
/** Build stage interface.*/
public interface IBuildStage {
/**
- * Supply the refresh token
+ * Supply the refresh token.
*
* @param refreshToken the refresh token
*
* @return this builder
*/
- public IBuildStage withRefreshToken(final String refreshToken);
+ IBuildStage withRefreshToken(final String refreshToken);
/**
* Supply the expiration.
@@ -214,7 +214,7 @@ public final class TokenResponse {
*
* @return this builder
*/
- public IBuildStage withExpiresIn(final Integer expiresIn);
+ IBuildStage withExpiresIn(final Integer expiresIn);
/**
* Supply the scope.
@@ -223,14 +223,14 @@ public final class TokenResponse {
*
* @return this builder
*/
- public IBuildStage withScope(final String scope);
+ IBuildStage withScope(final String scope);
/**
* Do the build.
*
* @return the response
*/
- public TokenResponse build();
+ TokenResponse build();
}
/**
diff --git a/idp-duo-sdk-client-impl/.checkstyle b/idp-duo-sdk-client-impl/.checkstyle
new file mode 100644
index 0000000..ddc9157
--- /dev/null
+++ b/idp-duo-sdk-client-impl/.checkstyle
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="false" sync-formatter="false">
+ <local-check-config name="Shibboleth Checkstyle" location="/java-idp-plugin-duo/resources/checkstyle/checkstyle.xml" type="project" description="">
+ <additional-data name="protect-config-file" value="false"/>
+ </local-check-config>
+ <fileset name="main" enabled="true" check-config-name="Shibboleth Checkstyle" local="true">
+ <file-match-pattern match-pattern="src/main/java/.*\.java$" include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/idp-duo-sdk-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/DuoSDKClientAdaptor.java b/idp-duo-sdk-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/DuoSDKClientAdaptor.java
index 34942f0..f6d354f 100644
--- a/idp-duo-sdk-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/DuoSDKClientAdaptor.java
+++ b/idp-duo-sdk-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/DuoSDKClientAdaptor.java
@@ -105,7 +105,8 @@ public final class DuoSDKClientAdaptor extends AbstractDuoOIDCClient{
integration.getAPIHost(), integration.getRedirectURI()).setUseDuoCodeAttribute(false).build();
} else {
client = new Client.Builder(integration.getClientId(), integration.getSecretKey(),
- integration.getAPIHost(), integration.getRedirectURI()).setCACerts(caCerts.toArray(new String[caCerts.size()]))
+ integration.getAPIHost(), integration.getRedirectURI()).setCACerts(
+ caCerts.toArray(new String[caCerts.size()]))
.setUseDuoCodeAttribute(false).build();
}
} catch (final DuoException e) {
diff --git a/checkstyle.xml b/resources/checkstyle/checkstyle.xml
similarity index 100%
rename from checkstyle.xml
rename to resources/checkstyle/checkstyle.xml
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list