Resource Server jwt Sample code
From ESS-WIKI
Revision as of 09:46, 17 January 2017 by Jonathan.lin (talk | contribs)
- Restful API for idTokenString from Openid Server
Base64.Decoder decoder = Base64.getDecoder(); String[] tokenParts = idTokenString.split("\\."); String tokenpayload = new String(decoder.decode(tokenParts[1]), "UTF-8"); JSONObject jsonObj = new JSONObject(tokenpayload); String username = jsonObj.getJSONObject("name").toString(); String email = jsonObj.getJSONObject("email").toString();