Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NPE issue when onfido claim mapping is not provided. #30

Conversation

AfraHussaindeen
Copy link
Contributor

@AfraHussaindeen AfraHussaindeen commented Dec 30, 2024

Purpose

  • $Subject

  • When performing Onfido identity verification for a user, a NullPointerException occurs if the Onfido connector is not configured with attribute mapping. This PR addresses the issue by returning a clear and meaningful response stating that the claim mapping is missing.

  • Before the fix

Screenshot 2024-12-30 at 21 40 08

Error log:

ERROR {org.wso2.carbon.identity.api.dispatcher.core.DefaultExceptionMapper} - Server encountered an error while serving the request. java.lang.NullPointerException: Null key.
	at org.json.JSONObject.put(JSONObject.java:2050)
	at org.wso2.carbon.identity.verification.onfido.connector.OnfidoIdentityVerifier.getApplicantRequestBody(OnfidoIdentityVerifier.java:745)
	at org.wso2.carbon.identity.verification.onfido.connector.OnfidoIdentityVerifier.createOrUpdateApplicant(OnfidoIdentityVerifier.java:351)
	at org.wso2.carbon.identity.verification.onfido.connector.OnfidoIdentityVerifier.initiateOnfidoVerification(OnfidoIdentityVerifier.java:164)
	at org.wso2.carbon.identity.verification.onfido.connector.OnfidoIdentityVerifier.verifyIdentity(OnfidoIdentityVerifier.java:104)
	at org.wso2.carbon.extension.identity.verification.mgt.IdentityVerificationManagerImpl.verifyIdentity(IdentityVerificationManagerImpl.java:108)
	at org.wso2.carbon.identity.rest.api.user.idv.v1.core.IdentityVerificationService.verifyIdentity(IdentityVerificationService.java:231)
	at org.wso2.carbon.identity.rest.api.user.idv.v1.impl.MeApiServiceImpl.meVerifyIdentity(MeApiServiceImpl.java:62)
	at org.wso2.carbon.identity.rest.api.user.idv.v1.MeApi.meVerifyIdentity(MeApi.java:117)
  • After the fix
Screenshot 2024-12-30 at 20 55 17

@AfraHussaindeen AfraHussaindeen self-assigned this Dec 30, 2024
@AfraHussaindeen AfraHussaindeen merged commit d75d4d0 into wso2-extensions:main Jan 6, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants