refactored json parser to a private static field.
parent
89056bd911
commit
1ffbb39a2b
|
@ -51,6 +51,8 @@ import com.nimbusds.jwt.JWTParser;
|
||||||
@Component("userInfoView")
|
@Component("userInfoView")
|
||||||
public class UserInfoView extends AbstractView {
|
public class UserInfoView extends AbstractView {
|
||||||
|
|
||||||
|
private static JsonParser jsonParser = new JsonParser();
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(UserInfoView.class);
|
private static Logger logger = LoggerFactory.getLogger(UserInfoView.class);
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -98,7 +100,7 @@ public class UserInfoView extends AbstractView {
|
||||||
JWT requestObject = JWTParser.parse(jwtString);
|
JWT requestObject = JWTParser.parse(jwtString);
|
||||||
|
|
||||||
// FIXME: move to GSON for easier processing
|
// FIXME: move to GSON for easier processing
|
||||||
JsonObject obj = (JsonObject) new JsonParser().parse(requestObject.getJWTClaimsSet().toJSONObject().toJSONString());
|
JsonObject obj = (JsonObject) jsonParser.parse(requestObject.getJWTClaimsSet().toJSONObject().toJSONString());
|
||||||
|
|
||||||
gson.toJson(toJsonFromRequestObj(userInfo, scope, obj), out);
|
gson.toJson(toJsonFromRequestObj(userInfo, scope, obj), out);
|
||||||
} catch (JsonSyntaxException e) {
|
} catch (JsonSyntaxException e) {
|
||||||
|
|
Loading…
Reference in New Issue