Switched from the manual implemented authentication-layer to Spring Security
[examples/facebook-app] / src / main / java / de / juplo / yourshouter / SecurityContextUserIdSource.java
diff --git a/src/main/java/de/juplo/yourshouter/SecurityContextUserIdSource.java b/src/main/java/de/juplo/yourshouter/SecurityContextUserIdSource.java
deleted file mode 100644 (file)
index 662da57..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-package de.juplo.yourshouter;
-
-import org.springframework.social.UserIdSource;
-import org.springframework.util.Assert;
-
-
-/**
- * Implementation of {@link UserIdSource}, that retrieves the ID of the current
- * user from the {@link SecurityContext}.
- *
- * @author Kai Moritz
- */
-public class SecurityContextUserIdSource implements UserIdSource
-{
-  /**
-   * Retrieves the ID of the current user from the {@link SecurityContext}.
-   * If no ID is found, an exception is thrown.
-   *
-   * @return The ID of the current user
-   * @throws IllegalStateException, if no current user is found.
-   */
-  @Override
-  public String getUserId()
-  {
-    Assert.state(SecurityContext.userSignedIn(), "No user signed in!");
-    return SecurityContext.getCurrentUser();
-  }
-}