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

OpenIdAuthenticationMechanism ClassCastException when used with Microsoft Entra, expires_in as string #375

Open
Anodarai opened this issue Feb 28, 2024 · 1 comment
Assignees

Comments

@Anodarai
Copy link

Microsoft Entra returns the expires_in field as a string, not a number eg.:
{"token_type":"Bearer","expires_in":"3599", (...)}
That causes a ClassCastException (class org.eclipse.parsson.JsonStringImpl cannot be cast to class jakarta.json.JsonNumber) in https://github.com/eclipse-ee4j/soteria/blame/e5f82534696f4b108f512701092b316cbb86584d/impl/src/main/java/org/glassfish/soteria/mechanisms/OpenIdAuthenticationMechanism.java#L498

While what Microsoft does here seems to be not to spec, I don't think it should cause the whole application to error out, instead it should log an error and continue, ignoring the value; or parse the string,

@arjantijms
Copy link
Contributor

Thanks for the report. I'll look into it. The fix can be done without needing a reproducer, but to be 100% safe if you do have a reproducible setup to share, that would be awesome.

@arjantijms arjantijms self-assigned this Mar 29, 2024
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