package com.medsocial.security;

import java.util.Collection;
import java.util.HashSet;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;

import com.medsocial.model.GaeUser;

public class GaeUserAuthentication implements Authentication {
	   private final GaeUser principal;
	   private final Object details;
	   private boolean authenticated;
	 
	   public GaeUserAuthentication(GaeUser principal, Object details) {
	       this.principal = principal;
	       this.details = details;
	       authenticated = true;
	   }
	 
	   public Collection<GrantedAuthority> getAuthorities() {
	       return new HashSet<GrantedAuthority>(principal.getAuthorities());
	   }
	 
	   public Object getCredentials() {
	       throw new UnsupportedOperationException();
	   }
	 
	   public Object getDetails() {
	       return null;
	   }
	 
	   public Object getPrincipal() {
	       return principal;
	   }
	 
	   public boolean isAuthenticated() {
	       return authenticated;
	   }
	 
	   public void setAuthenticated(boolean isAuthenticated) {
	       authenticated = isAuthenticated;
	   }
	 
	   public String getName() {
	       return principal.getUserId();
	   }
	 
	   @Override
	   public String toString() {
	       return "GaeUserAuthentication{" +
	               "principal=" + principal +
	               ", details=" + details +
	               ", authenticated=" + authenticated +
	               '}';
	   }
}

@@ -300,19 +300,88 @@
 tion %7B%0A%09
-   
+%0A%09private static final long serialVersionUID = 1617533952291603110L;%0A%09%0A%09
 private 

add serialVersionUID to make Eclipse shut up