本文整理汇总了Java中org.springframework.security.oauth2.client.OAuth2RestTemplate.postForEntity方法的典型用法代码示例。如果您正苦于以下问题:Java OAuth2RestTemplate.postForEntity方法的具体用法?Java OAuth2RestTemplate.postForEntity怎么用?Java OAuth2RestTemplate.postForEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.security.oauth2.client.OAuth2RestTemplate
的用法示例。
在下文中一共展示了OAuth2RestTemplate.postForEntity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: postMultipleSubjects
import org.springframework.security.oauth2.client.OAuth2RestTemplate; //导入方法依赖的package包/类
public ResponseEntity<Object> postMultipleSubjects(final OAuth2RestTemplate acsTemplate, final String endpoint,
final HttpHeaders headers, final BaseSubject... subjects) {
Attribute site = getDefaultAttribute();
Set<Attribute> attributes = new HashSet<>();
attributes.add(site);
List<BaseSubject> subjectsArray = new ArrayList<>();
for (BaseSubject s : subjects) {
s.setAttributes(attributes);
subjectsArray.add(s);
}
URI subjectUri = URI.create(endpoint + ACS_SUBJECT_API_PATH);
ResponseEntity<Object> responseEntity = acsTemplate.postForEntity(subjectUri,
new HttpEntity<>(subjectsArray, headers), Object.class);
return responseEntity;
}
示例2: postResources
import org.springframework.security.oauth2.client.OAuth2RestTemplate; //导入方法依赖的package包/类
public ResponseEntity<Object> postResources(final OAuth2RestTemplate acsTemplate, final String endpoint,
final BaseResource... resources) {
Attribute site = getDefaultAttribute();
Set<Attribute> attributes = new HashSet<>();
attributes.add(site);
List<BaseResource> resourcesArray = new ArrayList<>();
for (BaseResource r : resources) {
r.setAttributes(attributes);
resourcesArray.add(r);
}
URI resourceUri = URI.create(endpoint + ACS_RESOURCE_API_PATH);
ResponseEntity<Object> responseEntity = acsTemplate.postForEntity(resourceUri, resourcesArray, Object.class);
return responseEntity;
}
示例3: postSubjects
import org.springframework.security.oauth2.client.OAuth2RestTemplate; //导入方法依赖的package包/类
public ResponseEntity<Object> postSubjects(final OAuth2RestTemplate acsTemplate, final String endpoint,
final HttpHeaders headers, final BaseSubject... subjects) {
List<BaseSubject> subjectsArray = new ArrayList<>();
for (BaseSubject s : subjects) {
subjectsArray.add(s);
}
URI subjectUri = URI.create(endpoint + ACS_SUBJECT_API_PATH);
ResponseEntity<Object> responseEntity = acsTemplate.postForEntity(subjectUri,
new HttpEntity<>(subjectsArray, headers), Object.class);
return responseEntity;
}