--- /dev/null
+package de.juplo.yourshouter;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.social.connect.Connection;
+import org.springframework.social.connect.ConnectionKey;
+import org.springframework.social.connect.ConnectionSignUp;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * Extracts the local user-ID from the data given by the provider.
+ *
+ * @author Kai Moritz
+ */
+@Service
+public class ProviderUserIdConnectionSignUp implements ConnectionSignUp
+{
+ private final Logger LOG =
+ LoggerFactory.getLogger(ProviderUserIdConnectionSignUp.class);
+
+
+ /**
+ * This implementation simply reuse the ID, that was provided by the provider.
+ *
+ * @param connection
+ * The {@link Connection} for the unknown user.
+ * @return
+ * The user-ID, that was provided by the provider.
+ */
+ @Override
+ public String execute(Connection<?> connection)
+ {
+ ConnectionKey key = connection.getKey();
+ LOG.info(
+ "signing up user {} from provider {}",
+ key.getProviderUserId(),
+ key.getProviderId()
+ );
+ return key.getProviderUserId();
+ }
+}