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

Using under GlassFish app #76

Open
IldarMuhhamedjanov opened this issue Mar 28, 2023 · 1 comment
Open

Using under GlassFish app #76

IldarMuhhamedjanov opened this issue Mar 28, 2023 · 1 comment

Comments

@IldarMuhhamedjanov
Copy link

The using of this API in an app under GlassFish throws "javax.ws.rs.BadRequestException: HTTP 400 Bad Request" in the case if the AuthenticationRequest was build with the instruction "withAllowedInteractionsOrder(Collections.singletonList(Interaction.displayTextAndPIN(message)))".
The SK server receives the string "DISPLAY_TEXT_AND_PIN" instead of "displayTextAndPIN".

By default GF uses MOXY Json provider, not exactly the Jackson provider. And the annotation "@JsonValue" from the class InteractionFlow will be ignored.

ee.sk.smartid.rest.SmartIdRestConnector - Request is invalid for URI https://rp-api.smart-id.com/v2/authentication/etsi/PNOEE-

javax.ws.rs.BadRequestException: HTTP 400 Bad Request
at org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:1053)
at org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:859)
at org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$1(JerseyInvocation.java:743)
at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
at org.glassfish.jersey.internal.Errors.process(Errors.java:205)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:390)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:741)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:432)
at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:333)
at ee.sk.smartid.rest.SmartIdRestConnector.postRequest(SmartIdRestConnector.java:258)
at ee.sk.smartid.rest.SmartIdRestConnector.postAuthenticationRequest(SmartIdRestConnector.java:233)
at ee.sk.smartid.rest.SmartIdRestConnector.authenticate(SmartIdRestConnector.java:168)
at ee.sk.smartid.AuthenticationRequestBuilder.getAuthenticationResponse(AuthenticationRequestBuilder.java:356)
at ee.sk.smartid.AuthenticationRequestBuilder.initiateAuthentication(AuthenticationRequestBuilder.java:295)

@aasaru
Copy link
Contributor

aasaru commented Apr 11, 2023

Hi @IldarMuhhamedjanov

Thanks for the report.
I looked into the topic and I think one option would be to add
@XmlEnumValue("displayTextAndPIN")
to each enum.

I wonder if you could fork the library, add the enum values, and test if it solves the problem.

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

No branches or pull requests

2 participants