本文整理了Java中org.apache.oltu.oauth2.common.utils.JSONUtils.parseJSON()
方法的一些代码示例,展示了JSONUtils.parseJSON()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSONUtils.parseJSON()
方法的具体详情如下:
包路径:org.apache.oltu.oauth2.common.utils.JSONUtils
类名称:JSONUtils
方法名:parseJSON
暂无
代码示例来源:origin: apache/oltu
protected void setBody(String body) throws OAuthProblemException {
try {
this.body = body;
parameters = JSONUtils.parseJSON(body);
} catch (Throwable e) {
throw OAuthProblemException.error(OAuthError.CodeResponse.UNSUPPORTED_RESPONSE_TYPE,
"Invalid response! Response body is not " + OAuth.ContentType.JSON + " encoded");
}
}
代码示例来源:origin: org.apache.oltu.oauth2/org.apache.oltu.oauth2.client
protected void setBody(String body) throws OAuthProblemException {
try {
this.body = body;
parameters = JSONUtils.parseJSON(body);
} catch (Throwable e) {
throw OAuthProblemException.error(OAuthError.CodeResponse.UNSUPPORTED_RESPONSE_TYPE,
"Invalid response! Response body is not " + OAuth.ContentType.JSON + " encoded");
}
}
代码示例来源:origin: apache/oltu
protected void setBody(String body) throws OAuthProblemException {
try {
this.body = body;
parameters = JSONUtils.parseJSON(body);
} catch (Throwable e) {
throw OAuthProblemException.error(OAuthError.CodeResponse.UNSUPPORTED_RESPONSE_TYPE,
"Invalid response! Response body is not application/json encoded");
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.authenticator.social
private Map<String, Object> getUserInfoJson(String fbAuthUserInfoUrl, String userInfoFields, String token)
throws ApplicationAuthenticatorException {
String userInfoString = getUserInfoString(fbAuthUserInfoUrl, userInfoFields, token);
if (log.isDebugEnabled() && IdentityUtil.isTokenLoggable(IdentityConstants.IdentityTokens.USER_ID_TOKEN)) {
log.debug("UserInfoString : " + userInfoString);
}
Map<String, Object> jsonObject = JSONUtils.parseJSON(userInfoString);
return jsonObject;
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.authenticator.facebook
private Map<String, Object> getUserInfoJson(String fbAuthUserInfoUrl, String userInfoFields, String token)
throws ApplicationAuthenticatorException {
String userInfoString = getUserInfoString(fbAuthUserInfoUrl, userInfoFields, token);
if (log.isDebugEnabled() && IdentityUtil.isTokenLoggable(IdentityConstants.IdentityTokens.USER_ID_TOKEN)) {
log.debug("UserInfoString : " + userInfoString);
}
Map<String, Object> jsonObject = JSONUtils.parseJSON(userInfoString);
return jsonObject;
}
protected Map<String, Object> getUserInfoJson(String fbAuthUserInfoUrl, String userInfoFields, String token)
throws ApplicationAuthenticatorException {
String userInfoString = getUserInfoString(fbAuthUserInfoUrl, userInfoFields, token);
if (log.isDebugEnabled() && IdentityUtil.isTokenLoggable(IdentityConstants.IdentityTokens.USER_ID_TOKEN)) {
log.debug("UserInfoString : " + userInfoString);
}
Map<String, Object> jsonObject = JSONUtils.parseJSON(userInfoString);
return jsonObject;
}
代码示例来源:origin: org.everit.authentication/org.everit.authentication.oauth2.ri
private void setParameters(final String contentType, final String body)
throws OAuthProblemException {
if (contentType.contains("application/json")) {
try {
parameters = JSONUtils.parseJSON(body);
} catch (Throwable e) {
throw OAuthProblemException.error(OAuthError.CodeResponse.UNSUPPORTED_RESPONSE_TYPE,
"Invalid response! Response body is not " + OAuth.ContentType.JSON + " encoded");
}
} else {
parameters = OAuthUtils.decodeForm(body);
}
}
代码示例来源:origin: miltonio/milton2
@Override
protected void setBody(String body) throws OAuthProblemException {
this.body = body.trim();
if (isJson()) {
try {
parameters = JSONUtils.parseJSON(body);
} catch (Throwable e) {
throw OAuthProblemException.error(OAuthError.CodeResponse.UNSUPPORTED_RESPONSE_TYPE, "Invalid response! Response body is not " + OAuth.ContentType.JSON + " encoded");
}
} else {
parameters = OAuthUtils.decodeForm(body);
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.authenticator.social
Map<String, Object> jsonObject = JSONUtils.parseJSON(json);
Map<String, Object> profile = null;
profile = JSONUtils.parseJSON(jsonObject.entrySet().iterator().next().getValue().toString());
Map<String, Object> jsonObject = JSONUtils.parseJSON(json);
Map<String, Object> profile = null;
profile = JSONUtils.parseJSON(jsonObject.entrySet().iterator().next().getValue().toString());
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.authenticator.oidc
Map<String, Object> jsonObject = JSONUtils.parseJSON(json);
Map<String, Object> jsonObject = JSONUtils.parseJSON(json);
Map<String, Object> jsonObject = JSONUtils.parseJSON(json);
protected String getToken(String tokenEndPoint, String clientId, String clientSecret,
String callbackurl, String code) throws ApplicationAuthenticatorException {
OAuthClientRequest tokenRequest = null;
String token = null;
try {
tokenRequest =
buidTokenRequest(tokenEndPoint, clientId, clientSecret, callbackurl,
code);
String tokenResponse = sendRequest(tokenRequest.getLocationUri());
Map<String, Object> jsonObject = JSONUtils.parseJSON(tokenResponse);
token = (String) jsonObject.get(FacebookAuthenticatorConstants.FB_ACCESS_TOKEN);
if (StringUtils.isEmpty(token)) {
throw new ApplicationAuthenticatorException("Could not receive a valid access token from FB");
}
} catch (MalformedURLException e) {
if (log.isDebugEnabled()) {
log.debug("URL : " + tokenRequest.getLocationUri());
}
throw new ApplicationAuthenticatorException(
"MalformedURLException while sending access token request.",
e);
} catch (IOException e) {
throw new ApplicationAuthenticatorException("IOException while sending access token request.", e);
}
return token;
}
代码示例来源:origin: miltonio/milton2
responseMap = JSONUtils.parseJSON(resourceResponseBody);
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.authenticator.oidc
String json = new String(decoded);
jsonObject = JSONUtils.parseJSON(json);
内容来源于网络,如有侵权,请联系作者删除!