[java-idp-plugin-webauthn] branch main updated: Fix possible NPE

Phil Smart philip.smart at jisc.ac.uk
Tue May 14 08:19:12 UTC 2024


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

philsmart pushed a commit to branch main
in repository java-idp-plugin-webauthn.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-webauthn.git;a=commit;h=7828d44f49a28f3568b8dfbb0b71629356452d0c

The following commit(s) were added to refs/heads/main by this push:
     new 7828d44  Fix possible NPE
7828d44 is described below

commit 7828d44f49a28f3568b8dfbb0b71629356452d0c
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Tue May 14 09:19:10 2024 +0100

    Fix possible NPE
---
 .../webauthn/admin/impl/AllowCurrentUserAccessPredicate.java      | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AllowCurrentUserAccessPredicate.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AllowCurrentUserAccessPredicate.java
index accffa0..290a0f5 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AllowCurrentUserAccessPredicate.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/AllowCurrentUserAccessPredicate.java
@@ -114,7 +114,13 @@ public class AllowCurrentUserAccessPredicate extends AbstractIdentifiableInitial
     public boolean test(final ProfileRequestContext profileRequestContext) {
         
         final WebAuthnRegistrationContext regContext = 
-                webauthnRegistrationContextLookupStrategy.apply(profileRequestContext);        
+                webauthnRegistrationContextLookupStrategy.apply(profileRequestContext);
+        
+        if (regContext == null) {
+            log.debug("{}: Registration context not found, access requires a registration context", getId());
+            return false;
+        }
+        
         final String usernameFromRegistrationContext = regContext.getUsername();
         
         final SubjectContext subjectContext = subjectContextLookupStrategy.apply(profileRequestContext);

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


More information about the commits mailing list