-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
io.quarkus.oidc.OidcSession uses Instant to present duration #27122
Comments
/cc @pedroigor, @sberyozkin |
I agree, this does not look correct. However |
ID token's expiry is a number of seconds since the epoch, see https://openid.net/specs/openid-connect-core-1_0.html#IDToken. That expiry date shown in the description looks wrong to me. |
After checking the implementation (https://github.com/quarkusio/quarkus/blob/main/extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcSessionImpl.java)
It returns actually a duration (from the meaning, not Java class) when the method is triggered. |
Hmm. It does look wrong to me now, as indeed it returns a duration from the epoch, it was really meant to be I'll fix it as proposed by Georgios |
Actually, I'll keep this method undeprecated and just return an |
Describe the bug
In, io.quarkus.oidc.OidcSession (https://github.com/quarkusio/quarkus/blob/main/extensions/oidc/runtime/src/main/java/io/quarkus/oidc/OidcSession.java),
it uses Instant to present duration.
Based on Javadoc, it is an instantaneous point on the time-line. But the comment says "how long", it should be Duration.
When using it in app, it seems that the value is filled with Duration too.
e.g. One value I got is
"expiresIn": "1970-01-01T00:23:05Z"
. I guess it means the session has 23 hours and 5 minutes to expire.Personally, I prefer to use Instant but it should assigned the correct time value (a duration value is a little hard to predict the ending time without base time) and the comment should be updated.
Expected behavior
Using Instant but it should assigned the correct time value (a duration value is a little hard to predict the ending time without base time) and the comment should be updated.
Actual behavior
It uses Instant with the wrong value and comment is misleading.
How to Reproduce?
Just any endpoint with injection of OidcSession.
Output of
uname -a
orver
Darwin Kernel Version 21.4.0
Output of
java -version
openjdk version "18" 2022-03-2
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.8.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 7.4.1
Additional information
No response
The text was updated successfully, but these errors were encountered: