...
Code Block | ||||
---|---|---|---|---|
| ||||
String token = getAuthToken(receivedHttpHeaders); String[] chunks = token.split("\\."); Base64.Decoder decoder = Base64.getUrlDecoder(); String payload = new String(decoder.decode(chunks[1])); JsonObject jsonObject = new JsonObject(); jsonObject.add("payload", JsonParser.parseString(payload)); String serviceId = jsonObject.getAsJsonObject("payload").get("serviceIdclient_id").getAsString(); //if the json token has the field serviceId |
Integrating with Existing Code
...