code: public static Map<String, Object> getAuthenticationResult() {
          Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
          if (authentication == null) {
              return null;
          }
          Map<String, Object> authenticationResult = new HashMap<String, Object>();
          authenticationResult.put("name", authentication.getName());
          String[] authorities = new String[authentication.getAuthorities().size()];
          int i=0;
          for (GrantedAuthority granted : authentication.getAuthorities()) {
              authorities[i++] = granted.getAuthority();
          }
          authenticationResult.put("authorities", authorities);
          return authenticationResult;
      }
docs: Checks for an {@link Authentication} object in the current {@link SecurityContext} and if one is found, constructs and returns
  a map that will result in an object of the expected format when returned to the Flex client.
  @return a map of the {@link Authentication} properties to be serialized over AMF, or null if no Authentication is found