@Bean @SuppressWarnings("unchecked") public AuthoritiesExtractor authoritiesExtractor(OAuth2RestOperations template) { return map -> { ArrayList<String> list = (ArrayList<String>) map.get("authorities"); if (!list.isEmpty()) { return AuthorityUtils.commaSeparatedStringToAuthorityList(StringUtils.collectionToCommaDelimitedString(list)); } return AuthorityUtils.commaSeparatedStringToAuthorityList("ROLE_USER"); }; }
public void setAuthoritiesExtractor(AuthoritiesExtractor authoritiesExtractor) { this.authoritiesExtractor = authoritiesExtractor; }
public void setAuthoritiesExtractor(AuthoritiesExtractor authoritiesExtractor) { Assert.notNull(authoritiesExtractor, "AuthoritiesExtractor must not be null"); this.authoritiesExtractor = authoritiesExtractor; }