upgrade-05-06.txt 1.2 KB

123456789101112131415161718192021222324252627
  1. ===============================================================================
  2. ACEGI SECURITY SYSTEM FOR SPRING - UPGRADING FROM 0.5 TO 0.6
  3. ===============================================================================
  4. The following should help most casual users of the project update their
  5. applications:
  6. - Locate and remove all property references to
  7. DaoAuthenticationProvider.key and
  8. DaoAuthenticationProvider.refreshTokenInterval.
  9. - If you are using DaoAuthenticationProvider and either (i) you are using
  10. container adapters or (ii) your code relies on the Authentication object
  11. having its getPrincipal() return a String, you must set the new
  12. DaoAuthenticationProvider property, forcePrincipalAsString, to true.
  13. By default DaoAuthenticationProvider returns an Authentication object
  14. containing the relevant User, which allows access to additional properties.
  15. Where possible, we recommend you change your code to something like this,
  16. so that you can leave forcePrincipalAsString to the false default:
  17. String username = authentication.getPrincipal();
  18. if (authentication.getPrincipal() instanceof User) {
  19. username = ((User) authentication.getPrincipal()).getUsername();
  20. }
  21. $Id$