List of usage examples for org.springframework.security.oauth2.client.token.grant.client ClientCredentialsResourceDetails setClientAuthenticationScheme
public void setClientAuthenticationScheme(AuthenticationScheme clientAuthenticationScheme)
From source file:org.cloudfoundry.identity.uaa.api.client.test.AbstractOperationTest.java
protected static void init() throws Exception { try {//from www . j a va2 s.com Socket test = new Socket("localhost", 8080); uaaRunning = true; test.close(); } catch (IOException e) { System.err.println("UAA is not running, skip these tests"); uaaRunning = false; return; } finally { String baseUrl = "http://localhost:8080/uaa"; ClientCredentialsResourceDetails credentials = new ClientCredentialsResourceDetails(); credentials.setAccessTokenUri(baseUrl + "/oauth/token"); // credentials.setAuthenticationScheme(AuthenticationScheme.header); credentials.setClientAuthenticationScheme(AuthenticationScheme.header); credentials.setClientId("admin"); credentials.setClientSecret("adminsecret"); connection = UaaConnectionFactory.getConnection(new URL(baseUrl), credentials); } }
From source file:org.cloudfoundry.identity.uaa.integration.util.IntegrationTestUtils.java
public static ClientCredentialsResourceDetails getClientCredentialsResource(String url, String[] scope, String clientId, String clientSecret) { ClientCredentialsResourceDetails resource = new ClientCredentialsResourceDetails(); resource.setClientId(clientId);// ww w . ja v a 2s. com resource.setClientSecret(clientSecret); resource.setId(clientId); if (scope != null) { resource.setScope(Arrays.asList(scope)); } resource.setClientAuthenticationScheme(AuthenticationScheme.header); resource.setAccessTokenUri(url + "/oauth/token"); return resource; }
From source file:org.cloudfoundry.identity.uaa.integration.OpenIdTokenAuthorizationWithApprovalIntegrationTests.java
private ClientCredentialsResourceDetails getClientCredentialsResource(String[] scope, String clientId, String clientSecret) {/* ww w . jav a 2 s . co m*/ ClientCredentialsResourceDetails resource = new ClientCredentialsResourceDetails(); resource.setClientId(clientId); resource.setClientSecret(clientSecret); resource.setId(clientId); if (scope != null) { resource.setScope(Arrays.asList(scope)); } resource.setClientAuthenticationScheme(AuthenticationScheme.header); resource.setAccessTokenUri(serverRunning.getBaseUrl() + "/oauth/token"); return resource; }
From source file:org.cloudfoundry.identity.uaa.login.feature.OpenIdTokenGrantsIT.java
private ClientCredentialsResourceDetails getClientCredentialsResource(String[] scope, String clientId, String clientSecret) {//from w w w . jav a 2 s .c o m ClientCredentialsResourceDetails resource = new ClientCredentialsResourceDetails(); resource.setClientId(clientId); resource.setClientSecret(clientSecret); resource.setId(clientId); if (scope != null) { resource.setScope(Arrays.asList(scope)); } resource.setClientAuthenticationScheme(AuthenticationScheme.header); resource.setAccessTokenUri(uaaUrl + "/oauth/token"); return resource; }
From source file:org.cloudfoundry.identity.uaa.integration.UaaTestAccounts.java
public ClientCredentialsResourceDetails getClientCredentialsResource(String clientId, String clientSecret) { ClientCredentialsResourceDetails resource = new ClientCredentialsResourceDetails(); resource.setClientId(clientId);// w ww.j a va2s . c o m resource.setClientSecret(clientSecret); resource.setId(clientId); resource.setScope(Arrays.asList("read", "write", "password")); resource.setClientAuthenticationScheme(AuthenticationScheme.header); resource.setAccessTokenUri(server.getAccessTokenUri()); return resource; }
From source file:org.cloudfoundry.identity.uaa.test.UaaTestAccounts.java
public ClientCredentialsResourceDetails getClientCredentialsResource(String[] scope, String clientId, String clientSecret) {//w w w.j av a 2 s . c om ClientCredentialsResourceDetails resource = new ClientCredentialsResourceDetails(); resource.setClientId(clientId); resource.setClientSecret(clientSecret); resource.setId(clientId); if (scope != null) { resource.setScope(Arrays.asList(scope)); } resource.setClientAuthenticationScheme(AuthenticationScheme.header); resource.setAccessTokenUri(server.getAccessTokenUri()); return resource; }