[java-idp-plugin-vci] branch main updated: Remove obsolete validator

Codeberg noreply at shibboleth.net
Wed Nov 18 06:13:57 UTC 2026


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch main
in repository java-idp-plugin-vci.

View the commit online:
https://codeberg.org/Shibboleth/java-idp-plugin-vci/commit/c37750b80abd9d57db82bc6e6fe9ef8e9f79076c

The following commit(s) were added to refs/heads/main by this push:
     new c37750b  Remove obsolete validator
c37750b is described below

commit c37750b80abd9d57db82bc6e6fe9ef8e9f79076c
Author: Janne Lauros <janne.lauros at csc.fi>
AuthorDate: Wed Nov 18 08:13:31 2026 +0200

    Remove obsolete validator
---
 README.md                                          | 25 ------
 .../conf/authn/oauth2client-authn-config.xml       | 16 ----
 .../conf/authn/oauth2client-authn-config.xml       | 16 ----
 .../conf/authn/oauth2client-authn-config.xml       | 16 ----
 .../conf/authn/oauth2client-authn-config.xml       | 16 ----
 .../authn/impl/WalletCredentialValidator.java      | 75 -----------------
 .../META-INF/net.shibboleth.idp/postconfig.xml     |  3 -
 .../authn/impl/WalletCredentialValidatorTest.java  | 98 ----------------------
 8 files changed, 265 deletions(-)

diff --git a/README.md b/README.md
index 106bd2d..711cb0c 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,6 @@
     - [Credential Configurations](#credential-configurations)
     - [Settings of your own, per credential](#settings-of-your-own-per-credential)
     - [Metadata endpoints](#metadata-endpoints)
-    - [Wallet authentication](#wallet-authentication)
     - [Pre-authorized code flow](#pre-authorized-code-flow)
     - [Authorization code flow](#authorization-code-flow)
     - [Status List](#status-list)
@@ -777,29 +776,6 @@ Full file: [etc/jetty-rewrite-rules.xml](docs/example/step-1/etc/jetty-rewrite-r
 
 </details>
 
-#### Wallet authentication
-
-**File(s):** *conf/authn/oauth2client-authn-config.xml*
-**Format:** Native Spring
-
-The wallets used in both flows are public clients. They use `none` as the authentication method
-at the token endpoint. Add the public-client validator to the list of client validators:
-
-<details>
-<summary>conf/authn/oauth2client-authn-config.xml</summary>
-
-```xml
-<util:list id="shibboleth.authn.OAuth2Client.Validators">
-    <ref bean="shibboleth.OIDCClientInfoValidator" />
-    <ref bean="shibboleth.JWTValidator" />
-    <ref bean="openidvci.PublicClientValidator" />
-</util:list>
-```
-
-Full file: [conf/authn/oauth2client-authn-config.xml](docs/example/step-1/conf/authn/oauth2client-authn-config.xml)
-
-</details>
-
 #### Pre-authorized code flow
 
 **File(s):** *metadata/oidc-client.json*, *conf/relying-party.xml*
@@ -5022,7 +4998,6 @@ Beans you can define or reference. Define your own beans in *conf/global.xml* or
 | **openidvci.ClientAttestationAttesters** | Map<String, List<String>> | | Wallets accepted with a Wallet Attestation, keyed by the client ID of the wallet, each with the subject names of the wallet provider certificates that sign its Wallet Attestations. Without the list every wallet is accepted with every certificate under a trust anchor. |
 | **openidvci.ClientAttestationCRLs** | List<Resource> | | CRLs of the trust anchors of Wallet Attestations, read again every `openidvci.attestation.crlRefreshInterval`. |
 | **openidvci.AttestationTrustEvaluator** | PKIXTrustEvaluator | `CertPathPKIXTrustEvaluator` | Evaluates the certificate chains of Wallet Attestations and key attestations. |
-| **openidvci.PublicClientValidator** | CredentialValidator | built in | Authenticates a public client, `none`. |
 | **openidvci.CredentialIssuerMetadata** | Resource | | Replaces the Credential Issuer metadata document wholesale. |
 | **openidvci.JWTVCIssuerMetadata** | Resource | | Replaces the JWT VC issuer metadata document wholesale. |
 | **openidvci.AuthorizationServerMetadata** | Resource | | Replaces the authorization server metadata document wholesale. |
diff --git a/docs/example/step-1/conf/authn/oauth2client-authn-config.xml b/docs/example/step-1/conf/authn/oauth2client-authn-config.xml
deleted file mode 100644
index f8d4131..0000000
--- a/docs/example/step-1/conf/authn/oauth2client-authn-config.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:util="http://www.springframework.org/schema/util"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
-       default-init-method="initialize"
-       default-destroy-method="destroy">
-
-    <util:list id="shibboleth.authn.OAuth2Client.Validators">
-        <ref bean="shibboleth.OIDCClientInfoValidator" />
-        <ref bean="shibboleth.JWTValidator" />
-        <ref bean="openidvci.PublicClientValidator" />
-    </util:list>
-
-</beans>
diff --git a/docs/example/step-2/conf/authn/oauth2client-authn-config.xml b/docs/example/step-2/conf/authn/oauth2client-authn-config.xml
deleted file mode 100644
index f8d4131..0000000
--- a/docs/example/step-2/conf/authn/oauth2client-authn-config.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:util="http://www.springframework.org/schema/util"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
-       default-init-method="initialize"
-       default-destroy-method="destroy">
-
-    <util:list id="shibboleth.authn.OAuth2Client.Validators">
-        <ref bean="shibboleth.OIDCClientInfoValidator" />
-        <ref bean="shibboleth.JWTValidator" />
-        <ref bean="openidvci.PublicClientValidator" />
-    </util:list>
-
-</beans>
diff --git a/docs/example/step-3/conf/authn/oauth2client-authn-config.xml b/docs/example/step-3/conf/authn/oauth2client-authn-config.xml
deleted file mode 100644
index f8d4131..0000000
--- a/docs/example/step-3/conf/authn/oauth2client-authn-config.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:util="http://www.springframework.org/schema/util"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
-       default-init-method="initialize"
-       default-destroy-method="destroy">
-
-    <util:list id="shibboleth.authn.OAuth2Client.Validators">
-        <ref bean="shibboleth.OIDCClientInfoValidator" />
-        <ref bean="shibboleth.JWTValidator" />
-        <ref bean="openidvci.PublicClientValidator" />
-    </util:list>
-
-</beans>
diff --git a/docs/example/step-4/conf/authn/oauth2client-authn-config.xml b/docs/example/step-4/conf/authn/oauth2client-authn-config.xml
deleted file mode 100644
index f8d4131..0000000
--- a/docs/example/step-4/conf/authn/oauth2client-authn-config.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:util="http://www.springframework.org/schema/util"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
-       default-init-method="initialize"
-       default-destroy-method="destroy">
-
-    <util:list id="shibboleth.authn.OAuth2Client.Validators">
-        <ref bean="shibboleth.OIDCClientInfoValidator" />
-        <ref bean="shibboleth.JWTValidator" />
-        <ref bean="openidvci.PublicClientValidator" />
-    </util:list>
-
-</beans>
diff --git a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/authn/impl/WalletCredentialValidator.java b/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/authn/impl/WalletCredentialValidator.java
deleted file mode 100644
index 35ef1a9..0000000
--- a/openid-vci-impl/src/main/java/org/geant/shibboleth/plugin/openidvci/authn/impl/WalletCredentialValidator.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2025, GÉANT
- *
- * Licensed under the Apache License, Version 2.0 (the “License”); you may not
- * use this file except in compliance with the License. You may obtain a copy
- * of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an “AS IS” BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.geant.shibboleth.plugin.openidvci.authn.impl;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import javax.security.auth.Subject;
-
-import net.shibboleth.idp.authn.AbstractCredentialValidator;
-import net.shibboleth.idp.authn.context.AuthenticationContext;
-import net.shibboleth.idp.authn.principal.UsernamePrincipal;
-import net.shibboleth.shared.annotation.constraint.ThreadSafeAfterInit;
-import net.shibboleth.shared.primitive.LoggerFactory;
-
-import org.geant.shibboleth.plugin.openidvci.profile.context.navigate.APIRequestClientIDLookupFunction;
-import org.opensaml.messaging.context.MessageContext;
-import org.opensaml.profile.context.ProfileRequestContext;
-import org.slf4j.Logger;
-
-import com.nimbusds.oauth2.sdk.AbstractOptionallyAuthenticatedRequest;
-import com.nimbusds.oauth2.sdk.id.ClientID;
-
-/**
- * Credential validator of a public client, located by {@link APIRequestClientIDLookupFunction}.
- */
- at ThreadSafeAfterInit
-public class WalletCredentialValidator extends AbstractCredentialValidator {
-
-    /** Class logger. */
-    @Nonnull
-    private final Logger log = LoggerFactory.getLogger(WalletCredentialValidator.class);
-
-    /** Strategy used to locate the client identifier of the request. */
-    @Nonnull
-    private final APIRequestClientIDLookupFunction clientIdLookupStrategy = new APIRequestClientIDLookupFunction();
-
-    /** {@inheritDoc} */
-    @Override
-    @Nullable
-    protected Subject doValidate(@Nonnull final ProfileRequestContext profileRequestContext,
-            @Nonnull final AuthenticationContext authenticationContext, @Nullable final WarningHandler warningHandler,
-            @Nullable final ErrorHandler errorHandler) throws Exception {
-
-        final MessageContext inbound = profileRequestContext.getInboundMessageContext();
-        final ClientID clientId = clientIdLookupStrategy.apply(inbound);
-        final String clientIdValue = clientId != null ? clientId.getValue() : null;
-        if (inbound == null || clientIdValue == null) {
-            log.debug("{} No client identifier found", getLogPrefix());
-            return null;
-        }
-        if (inbound.getMessage() instanceof AbstractOptionallyAuthenticatedRequest message
-                && message.getClientAuthentication() != null) {
-            log.debug("{} Client '{}' is not a public client", getLogPrefix(), clientIdValue);
-            return null;
-        }
-        final Subject subject = new Subject();
-        subject.getPrincipals().add(new UsernamePrincipal(clientIdValue));
-        log.info("{} Login by '{}' succeeded", getLogPrefix(), clientIdValue);
-        return super.populateSubject(subject);
-    }
-}
diff --git a/openid-vci-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml b/openid-vci-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
index 2b8a790..24a25b3 100644
--- a/openid-vci-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
+++ b/openid-vci-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
@@ -42,9 +42,6 @@
         class="org.springframework.beans.factory.config.ListFactoryBean"
         p:sourceList="#{getObject('shibboleth.AuthenticationFlowDescriptorManager').getComponents().?[id matches 'authn/(' + '%{openidvci.authn.flows:OpenIDVCIClient}'.trim() + ')']}" />
 
-    <bean id="openidvci.PublicClientValidator"
-        class="org.geant.shibboleth.plugin.openidvci.authn.impl.WalletCredentialValidator" />
-
     <bean id="openidvci.CredentialOfferCache" class="org.geant.shibboleth.plugin.openidvci.storage.CredentialOfferCache"
         lazy-init="true" depends-on="shibboleth.LoggingService"
         p:storage-ref="#{'%{openidvci.StorageService:shibboleth.StorageService}'.trim()}" />
diff --git a/openid-vci-impl/src/test/java/org/geant/shibboleth/plugin/openidvci/authn/impl/WalletCredentialValidatorTest.java b/openid-vci-impl/src/test/java/org/geant/shibboleth/plugin/openidvci/authn/impl/WalletCredentialValidatorTest.java
deleted file mode 100644
index 27afe1a..0000000
--- a/openid-vci-impl/src/test/java/org/geant/shibboleth/plugin/openidvci/authn/impl/WalletCredentialValidatorTest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2025, GÉANT
- *
- * Licensed under the Apache License, Version 2.0 (the “License”); you may not
- * use this file except in compliance with the License. You may obtain a copy
- * of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an “AS IS” BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.geant.shibboleth.plugin.openidvci.authn.impl;
-
-import java.net.URI;
-
-import javax.security.auth.Subject;
-
-import org.geant.shibboleth.plugin.openidvci.messaging.impl.OpenIDVCITokenRequest;
-import org.opensaml.profile.context.ProfileRequestContext;
-import org.testng.Assert;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import com.nimbusds.common.contenttype.ContentType;
-import com.nimbusds.oauth2.sdk.AuthorizationCode;
-import com.nimbusds.oauth2.sdk.AuthorizationCodeGrant;
-import com.nimbusds.oauth2.sdk.TokenRequest;
-import com.nimbusds.oauth2.sdk.auth.ClientSecretBasic;
-import com.nimbusds.oauth2.sdk.auth.Secret;
-import com.nimbusds.oauth2.sdk.http.HTTPRequest;
-import com.nimbusds.oauth2.sdk.id.ClientID;
-
-import net.shibboleth.idp.authn.context.AuthenticationContext;
-import net.shibboleth.idp.authn.principal.UsernamePrincipal;
-
-/** Unit tests for {@link WalletCredentialValidator}. */
-public class WalletCredentialValidatorTest {
-
-    private ProfileRequestContext prc;
-
-    private WalletCredentialValidator validator;
-
-    @BeforeMethod
-    protected void setUp() throws Exception {
-        prc = new ProfileRequestContext();
-        validator = new WalletCredentialValidator();
-        validator.setId("test");
-        validator.initialize();
-    }
-
-    private HTTPRequest request(final String body) throws Exception {
-        final HTTPRequest httpRequest = new HTTPRequest(HTTPRequest.Method.POST, new URI("https://issuer.example.org"));
-        httpRequest.setContentType(ContentType.APPLICATION_URLENCODED.toString());
-        httpRequest.setBody(body);
-        return httpRequest;
-    }
-
-    private Subject validate() throws Exception {
-        return validator.validate(prc, new AuthenticationContext(), null, null);
-    }
-
-    @Test
-    public void testPublicClient() throws Exception {
-        prc.ensureInboundMessageContext().setMessage(OpenIDVCITokenRequest
-                .parse(request("client_id=wallet&grant_type=refresh_token&refresh_token=abc&scope=openid")));
-        final Subject subject = validate();
-        Assert.assertNotNull(subject);
-        Assert.assertTrue(subject.getPrincipals().contains(new UsernamePrincipal("wallet")));
-    }
-
-    @Test
-    public void testAuthenticatedClient() throws Exception {
-        final HTTPRequest httpRequest = request("grant_type=client_credentials&scope=read");
-        httpRequest.setAuthorization(
-                new ClientSecretBasic(new ClientID("wallet"), new Secret("secret")).toHTTPAuthorizationHeader());
-        prc.ensureInboundMessageContext().setMessage(OpenIDVCITokenRequest.parse(httpRequest));
-        Assert.assertNull(validate());
-    }
-
-    @Test
-    public void testOtherMessage() throws Exception {
-        prc.ensureInboundMessageContext().setMessage(new TokenRequest(new URI("https://issuer.example.org"),
-                new ClientID("wallet"), new AuthorizationCodeGrant(new AuthorizationCode("code"),
-                        new URI("https://wallet.example.org/cb"))));
-        Assert.assertNull(validate());
-    }
-
-    @Test
-    public void testNoInboundMessageContext() throws Exception {
-        Assert.assertNull(validate());
-    }
-
-}

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list