private String getAutoApproveScopes(ClientDetails clientDetails) { if (clientDetails.isAutoApprove("true")) { return "true"; // all scopes autoapproved } Set<String> scopes = new HashSet<String>(); for (String scope : clientDetails.getScope()) { if (clientDetails.isAutoApprove(scope)) { scopes.add(scope); } } return StringUtils.collectionToCommaDelimitedString(scopes); }
private String getAutoApproveScopes(ClientDetails clientDetails) { if (clientDetails.isAutoApprove("true")) { return "true"; // all scopes autoapproved } Set<String> scopes = new HashSet<String>(); for (String scope : clientDetails.getScope()) { if (clientDetails.isAutoApprove(scope)) { scopes.add(scope); } } return collectionToCommaDelimitedString(scopes); }
ClientDetails client = clientDetailsService.loadClientByClientId(clientId); for (String scope : requestedScopes) { if (client.isAutoApprove(scope)) { approvedScopes.add(scope);
approved = true; for (String scope : scopes) { if (!client.isAutoApprove(scope)) { approved = false;
approved = true; for (String scope : scopes) { if (!client.isAutoApprove(scope)) { approved = false;
@Test public void testValidateClientsTransferAutoApproveScopeSet() throws Exception { List<String> scopes = Arrays.asList("scope1", "scope2"); input.setAutoApproveScopes(new HashSet<String>(scopes)); ClientDetails test = endpoints.getClientDetailsValidator().validate(input, Mode.CREATE); for (String scope:scopes) { assertTrue("Client should have "+scope+" autoapprove.", test.isAutoApprove(scope)); } }
assertEquals(new Integer(200), clientDetails.getRefreshTokenValiditySeconds()); assertTrue(clientDetails.isAutoApprove("read"));
private String getAutoApproveScopes(ClientDetails clientDetails) { if (clientDetails.isAutoApprove("true")) { return "true"; // all scopes autoapproved } Set<String> scopes = new HashSet<String>(); for (String scope : clientDetails.getScope()) { if (clientDetails.isAutoApprove(scope)) { scopes.add(scope); } } return StringUtils.collectionToCommaDelimitedString(scopes); }
public static String getAutoApproveScopes(ClientDetails clientDetails) { if (clientDetails.isAutoApprove("true")) { return "true"; // all scopes autoapproved } Set<String> scopes = new HashSet<String>(); for (String scope : clientDetails.getScope()) { if (clientDetails.isAutoApprove(scope)) { scopes.add(scope); } } return StringUtils.collectionToCommaDelimitedString(scopes); }
private String getAutoApproveScopes(ClientDetails clientDetails) { if (clientDetails.isAutoApprove("true")) { return "true"; } else { Set<String> scopes = new HashSet(); Iterator var3 = clientDetails.getScope().iterator(); while(var3.hasNext()) { String scope = (String)var3.next(); if (clientDetails.isAutoApprove(scope)) { scopes.add(scope); } } return StringUtils.collectionToCommaDelimitedString(scopes); } }
approved = true; for (String scope : scopes) { if (!client.isAutoApprove(scope)) { approved = false;
ClientDetails client = clientDetailsService.loadClientByClientId(clientId); for (String scope : requestedScopes) { if (client.isAutoApprove(scope)) { approvedScopes.add(scope);
.loadClientByClientId(authorizationRequest.getClientId()); for (String scope : requestedScopes) { if (client.isAutoApprove(scope) || client.isAutoApprove("all")) { approved = true; break;
.loadClientByClientId(authorizationRequest.getClientId()); for (String scope : requestedScopes) { if (client.isAutoApprove(scope) || client.isAutoApprove("all")) { approved = true; break;
@Test public void testEnvironmentalOverrides() { this.context = new AnnotationConfigServletWebServerApplicationContext(); TestPropertyValues .of("security.oauth2.client.clientId:myclientid", "security.oauth2.client.clientSecret:mysecret", "security.oauth2.client.autoApproveScopes:read,write", "security.oauth2.client.accessTokenValiditySeconds:40", "security.oauth2.client.refreshTokenValiditySeconds:80") .applyTo(this.context); this.context.register(AuthorizationAndResourceServerConfiguration.class, MinimalSecureWebApplication.class); this.context.refresh(); ClientDetails config = this.context.getBean(ClientDetails.class); assertThat(config.getClientId()).isEqualTo("myclientid"); assertThat(config.getClientSecret()).isEqualTo("mysecret"); assertThat(config.isAutoApprove("read")).isTrue(); assertThat(config.isAutoApprove("write")).isTrue(); assertThat(config.isAutoApprove("foo")).isFalse(); assertThat(config.getAccessTokenValiditySeconds()).isEqualTo(40); assertThat(config.getRefreshTokenValiditySeconds()).isEqualTo(80); verifyAuthentication(config); }
.loadClientByClientId(authorizationRequest.getClientId()); for (String scope : requestedScopes) { if (client.isAutoApprove(scope)) { approved = true; break;