-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Type cast error in sample code at JWT token section #1200
Labels
waiting for release
Issue is fix, waiting on new release
Milestone
Comments
Thanks for submitting your first issue, we will have a look as quickly as possible. |
@jp3pe the code is also part of the Java code in
can you share your code? |
Looking at the issue again, the issue is:
updated the code accordingly. @jp3pe thanks for raising this issue. |
Closing as we released 2023.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Test environment
java: zulu-17
Build: Gradle
Added dependencies: (io.jsonwebtoken:jjwt:0.9.1', javax.xml.bind:jaxb-api:2.3.1)
Location
JWT tokens section-7th problem-second sample code
/WebGoat/start.mvc#lesson/JWT.lesson/6
Issue
At the second sample code on the page, the code convert
claims.get("admin")
to(String)
.I ran the code and it return the error
class java.lang.Boolean cannot be cast to class java.lang.String
Solution
Change
Boolean.valueOf((String) claims.get("admin"))
toBoolean.valueOf(String.valueOf(claims.get("admin")))
PS
I'm not good at Java and Web security.
If the issue was occurred by a different JVM version or my misunderstanding, please ignore it.
The text was updated successfully, but these errors were encountered: