casdoor / casdoor-java-sdk

Java client SDK for Casdoor
https://github.com/casdoor/casdoor
Apache License 2.0
27 stars 43 forks source link

Access token not found in JWT payload #55

Closed zeekrs closed 1 year ago

zeekrs commented 1 year ago
CleanShot 2023-08-08 at 22 36 54@2x

Is there any issue with my jwttoken ? i'm upgrade the spring-starter version to 1.9.0 and the sdk version is 1.16.1

parse the jwttoken it has 60 size claims but haven't access_token

54 #53

casbin-bot commented 1 year ago

@seriouszyx @ComradeProgrammer @Resulte

hsluoyz commented 1 year ago

@zeekrs use latest Casdoor version

zeekrs commented 1 year ago

the version 1.16.1 dos not the latest? and i can't find the 1.9.1 starter version on maven central

hsluoyz commented 1 year ago

@zeekrs I mean latest "Casdoor" version, latest is v1.383.0: https://github.com/casdoor/casdoor/releases/tag/v1.383.0

Not this Java SDK or Spring Starter

zeekrs commented 1 year ago

ok i will try it , now i use the latest docker image , it maybe not new

zeekrs commented 1 year ago

thx

zeekrs commented 1 year ago

sorry , i'm upgrade the casdoor version to , The problem still exists. i view the casdoor code on master branch. token_jwt.go line 226 function generateJwtToken i think it never put a key of access_token in the claims (i'm not a gopher) why the java-sdk will get a access_token in claims ? dos this a bug or some wrong with myself , I have no idea

zhengwangwang commented 1 year ago

I encountered the same problem. This variable claimsSet in parseJwtToken(String token) method is parsed userjson,but not the accessToken. in v1.15.0 readValue from payloadJson.toString()