/** * Set the group of {@link SocialAuthenticationService}s registered in this registry. * JavaBean setter that allows for this object to be more easily configured by tools. * For programmatic configuration, prefer {@link #addAuthenticationService(SocialAuthenticationService)}. * @param authenticationServices the set of social authentication services to register */ public void setAuthenticationServices(Iterable<SocialAuthenticationService<?>> authenticationServices) { for (SocialAuthenticationService<?> authenticationService : authenticationServices) { addAuthenticationService(authenticationService); } }
/** * Set the group of {@link SocialAuthenticationService}s registered in this registry. * JavaBean setter that allows for this object to be more easily configured by tools. * For programmatic configuration, prefer {@link #addAuthenticationService(SocialAuthenticationService)}. * @param authenticationServices the set of social authentication services to register */ public void setAuthenticationServices(Iterable<SocialAuthenticationService<?>> authenticationServices) { for (SocialAuthenticationService<?> authenticationService : authenticationServices) { addAuthenticationService(authenticationService); } }
@Autowired @Bean public SocialAuthenticationServiceRegistry socialAuthenticationServiceLocator( final List<SocialAuthenticationService> services) { SocialAuthenticationServiceRegistry socialAuthenticationServiceRegistry = new SocialAuthenticationServiceRegistry(); for (final SocialAuthenticationService service : services) { socialAuthenticationServiceRegistry.addAuthenticationService(service); } return socialAuthenticationServiceRegistry; }
public void addConnectionFactory(ConnectionFactory<?> connectionFactory) { registry.addAuthenticationService(wrapAsSocialAuthenticationService(connectionFactory)); }
@Override public UsersConnectionRepository getUsersConnectionRepository( final ConnectionFactoryLocator connectionFactoryLocator) { final ClientCredentialsSupplier ccs = getClientCredentialsSupplier(); // this is hacky, but didn't found out how to do these configuration // without it if (connectionFactoryLocator instanceof SocialAuthenticationServiceRegistry) { log.debug("Initialize ConnectionFactory with key {} and secret {}", ccs.getClientId().substring(0, getClientIdSubstringLenght()), ccs.getClientSecret().substring(0, getClientSecretIdSubstringCount())); SocialAuthenticationServiceRegistry registry = (SocialAuthenticationServiceRegistry) connectionFactoryLocator; registry.addAuthenticationService(new ZAuthAuthenticationService(ccs, getCustomParameters(), getAuthorizationEndpoint(), getTokenEndpoint())); } return doGetUsersConnectionRepository(connectionFactoryLocator); }