use of org.apache.cxf.jaxrs.provider.json.JsonMapObjectProvider in project testcases by coheigea.
the class KeysTest method setupProviders.
private static List<Object> setupProviders() {
List<Object> providers = new ArrayList<Object>();
JSONProvider<OAuthAuthorizationData> jsonP = new JSONProvider<OAuthAuthorizationData>();
jsonP.setNamespaceMap(Collections.singletonMap("http://org.apache.cxf.rs.security.oauth", "ns2"));
providers.add(jsonP);
providers.add(new OAuthJSONProvider());
providers.add(new JsonWebKeysProvider());
providers.add(new JsonMapObjectProvider());
return providers;
}
use of org.apache.cxf.jaxrs.provider.json.JsonMapObjectProvider in project testcases by coheigea.
the class UserInfoTest method setupProviders.
private static List<Object> setupProviders() {
List<Object> providers = new ArrayList<Object>();
JSONProvider<OAuthAuthorizationData> jsonP = new JSONProvider<OAuthAuthorizationData>();
jsonP.setNamespaceMap(Collections.singletonMap("http://org.apache.cxf.rs.security.oauth", "ns2"));
providers.add(jsonP);
providers.add(new OAuthJSONProvider());
providers.add(new JsonWebKeysProvider());
providers.add(new JsonMapObjectProvider());
return providers;
}
use of org.apache.cxf.jaxrs.provider.json.JsonMapObjectProvider in project cxf by apache.
the class BigQueryServer method main.
public static void main(String[] args) throws Exception {
final String pc12File = args[0];
final String keySecret = args[1];
final String issuer = args[2];
final String projectId = args[3];
PrivateKey privateKey = loadPrivateKey(pc12File, keySecret);
ClientAccessToken accessToken = getAccessToken(privateKey, issuer);
WebClient bigQueryClient = WebClient.create("https://www.googleapis.com/bigquery/v2/projects/" + projectId + "/queries", Collections.singletonList(new JsonMapObjectProvider()));
bigQueryClient.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON);
List<ShakespeareText> texts = BigQueryService.getMatchingTexts(bigQueryClient, accessToken, "brave", "10");
System.out.println("Matching texts:");
for (ShakespeareText text : texts) {
System.out.println(text.getText() + ":" + text.getDate());
}
}
use of org.apache.cxf.jaxrs.provider.json.JsonMapObjectProvider in project cxf by apache.
the class OAuth2TestUtils method setupProviders.
public static List<Object> setupProviders() {
JSONProvider<OAuthAuthorizationData> jsonP = new JSONProvider<>();
jsonP.setNamespaceMap(Collections.singletonMap("http://org.apache.cxf.rs.security.oauth", "ns2"));
return Arrays.asList(jsonP, new OAuthJSONProvider(), new JsonWebKeysProvider(), new JsonMapObjectProvider());
}
use of org.apache.cxf.jaxrs.provider.json.JsonMapObjectProvider in project cxf by apache.
the class JAXRSOAuth2TlsTest method createDynRegWebClient.
private WebClient createDynRegWebClient(String address) {
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
bean.setAddress(address);
bean.setProvider(new JsonMapObjectProvider());
SpringBusFactory bf = new SpringBusFactory();
URL busFile = JAXRSOAuth2TlsTest.class.getResource("client.xml");
Bus springBus = bf.createBus(busFile.toString());
bean.setBus(springBus);
WebClient wc = bean.createWebClient();
wc.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON);
return wc;
}
Aggregations