Skip to content

Commit

Permalink
Setup for 1.1
Browse files Browse the repository at this point in the history
- Update for Shibboleth IdP 4.2 compatibility
  • Loading branch information
sromunen committed Jan 18, 2023
1 parent 61de864 commit 7d36123
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 21 deletions.
31 changes: 25 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,27 @@ THE SOFTWARE.
-->
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.shibboleth.idp</groupId>
<artifactId>idp-parent</artifactId>
<version>4.0.0</version>
<groupId>net.shibboleth</groupId>
<artifactId>parent</artifactId>
<version>11.3.3</version>
</parent>
<groupId>fi.mpass</groupId>
<artifactId>idp-authn-impl-jwt</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.1</version>
<packaging>jar</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<shib.idp.version>4.0.0</shib.idp.version>
<nimbusds-version>9.23</nimbusds-version>
<shib.idp.version>4.2.1</shib.idp.version>
<checkstyle.configLocation>mpassid-checkstyle.xml</checkstyle.configLocation>
<automatic.module.name>fi.mpass.authn.jwt.impl</automatic.module.name>
<opensaml.groupId>org.opensaml</opensaml.groupId>
<opensaml.version>4.2.0</opensaml.version>
</properties>

<repositories>
Expand Down Expand Up @@ -71,7 +75,7 @@ THE SOFTWARE.
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>8.8</version>
<version>${nimbusds-version}</version>
</dependency>
<dependency>
<groupId>net.shibboleth.idp</groupId>
Expand All @@ -89,6 +93,11 @@ THE SOFTWARE.
<version>${shib.idp.version}</version>
</dependency>
<!-- Provided Dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>

<!-- Runtime Dependencies -->

Expand Down Expand Up @@ -140,6 +149,16 @@ THE SOFTWARE.
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,9 @@

import javax.annotation.Nonnull;
import javax.security.auth.Subject;
//import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequest;

import net.shibboleth.idp.authn.AbstractValidationAction;
import net.shibboleth.idp.authn.AuthnEventIds;
import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.principal.UsernamePrincipal;
import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
import net.shibboleth.utilities.java.support.logic.Constraint;
import net.shibboleth.utilities.java.support.logic.ConstraintViolationException;
import net.shibboleth.utilities.java.support.primitive.StringSupport;

import org.opensaml.profile.action.ActionSupport;
import org.opensaml.profile.action.EventIds;
import org.opensaml.profile.context.ProfileRequestContext;
Expand All @@ -49,6 +40,16 @@
import com.nimbusds.jose.crypto.MACVerifier;
import com.nimbusds.jwt.SignedJWT;

import net.shibboleth.idp.authn.AbstractValidationAction;
import net.shibboleth.idp.authn.AuthnEventIds;
import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.principal.UsernamePrincipal;
import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
import net.shibboleth.utilities.java.support.logic.Constraint;
import net.shibboleth.utilities.java.support.logic.ConstraintViolationException;
import net.shibboleth.utilities.java.support.primitive.StringSupport;

/**
* An action that checks for incoming JWT token and produces an
* {@link net.shibboleth.idp.authn.AuthenticationResult} or records error if the configured user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
import com.nimbusds.jose.Payload;
import com.nimbusds.jose.crypto.MACSigner;

import fi.mpass.shibboleth.authn.impl.ValidateJwtTokenAuthentication;
import net.shibboleth.idp.authn.AuthenticationResult;
import net.shibboleth.idp.authn.AuthnEventIds;
import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.impl.BaseAuthenticationContextTest;
import net.shibboleth.idp.profile.ActionTestingSupport;
import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
import net.shibboleth.idp.profile.testing.ActionTestingSupport;
import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.logic.ConstraintViolationException;

/**
Expand All @@ -68,8 +68,9 @@ public class ValidateJwtTokenAuthenticationTest extends BaseAuthenticationContex

private String jwtParameterName;

/** {@inheritDoc} */
@BeforeMethod public void setUp() throws Exception {
/** {@inheritDoc}
* @throws ComponentInitializationException */
@BeforeMethod public void setUp() throws ComponentInitializationException {
super.setUp();
uidConfig = "username";
uid = "mockUser";
Expand Down

0 comments on commit 7d36123

Please sign in to comment.