You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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")) to Boolean.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:
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: