debug.jsp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <%@ page import="net.sf.acegisecurity.context.Context" %>
  2. <%@ page import="net.sf.acegisecurity.context.ContextHolder" %>
  3. <%@ page import="net.sf.acegisecurity.context.SecureContext" %>
  4. <%@ page import="net.sf.acegisecurity.Authentication" %>
  5. <%@ page import="net.sf.acegisecurity.GrantedAuthority" %>
  6. <%@ page import="net.sf.acegisecurity.adapters.AuthByAdapter" %>
  7. <% Context context = ContextHolder.getContext();
  8. if (context != null) { %>
  9. Context on ContextHolder is of type: <%= context.getClass().getName() %><BR><BR>
  10. <% if (context instanceof SecureContext) { %>
  11. The Context implements SecureContext.<BR><BR>
  12. <% SecureContext sc = (SecureContext) context;
  13. Authentication auth = sc.getAuthentication();
  14. if (auth != null) { %>
  15. Authentication object is of type: <%= auth.getClass().getName() %><BR><BR>
  16. Authentication object as a String: <%= auth.toString() %><BR><BR>
  17. Authentication object holds the following granted authorities:<BR><BR>
  18. <% GrantedAuthority[] granted = auth.getAuthorities();
  19. for (int i = 0; i < granted.length; i++) { %>
  20. <%= granted[i].toString() %> (getAuthority(): <%= granted[i].getAuthority() %>)<BR>
  21. <% }
  22. if (auth instanceof AuthByAdapter) { %>
  23. <BR><B>SUCCESS! Your container adapter appears to be properly configured!</B><BR><BR>
  24. <% } else { %>
  25. <BR><B>SUCCESS! Your web filter appears to be properly configured!</B><BR>
  26. <% }
  27. } else { %>
  28. Authentication object is null.<BR>
  29. This is an error and your container adapter will not operate properly until corrected.<BR><BR>
  30. <% }
  31. } else { %>
  32. <B>ContextHolder does not contain a SecureContext.</B><BR>
  33. This is an error and your container adapter will not operate properly until corrected.<BR><BR>
  34. <% }
  35. } else { %>
  36. <B>ContextHolder on ContextHolder is null.</B><BR>
  37. This indicates improper setup of the container adapter. Refer to the reference documentation.<BR>
  38. Also ensure the correct subclass of AbstractMvcIntegrationInterceptor is being used for your container.<BR>
  39. <%}
  40. %>