Results 1 to 5 of 5

Thread: Common question? Auditing...

  1. #1
    Join Date
    May 2005
    Posts
    11

    Default Common question? Auditing...

    I'm planning to create some Audit logging Aspects for my project (Spring/hibernate/acegi).

    I have a filter that checks for the Acegi credential in the Session scope. If so I retrieve an instance of my own User class and store it in the Session for later use.

    Now for implementing the Audit aspect I need these credential objects.

    Is it possible to store the Acegi user credential (or my own User object) in the Spring Context and retrieve it from my Aspect or is there another way do to this?
    Another option is to give the User object as a method parameter on each method in the Service layer, but this is against the beauty of AOP, no?

    Any help much appreciated.

  2. #2

    Default

    May be I didn't get it. But I don't see a compelling reason to store acegi credentials on the userinfo object. It's all in the session so the credentials can be used anytime by the AOP.
    Neeraj Kumar

  3. #3
    Join Date
    May 2005
    Posts
    11

    Default

    Quote Originally Posted by neeraj_cmu
    May be I didn't get it. But I don't see a compelling reason to store acegi credentials on the userinfo object. It's all in the session so the credentials can be used anytime by the AOP.
    So it is possible to retrieve the Session credential? Can you tell me how to achieve this?

  4. #4
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    What's meant by a Session? You mean a HttpSession? That's not an ideal place to access your Authentication object, as it will not be available outside the web tier.

    It's better to use ((SecureContext)ContextHolder.getContext()).getAut hentication() to obtain your Authentication for generating your audit records.

  5. #5
    Join Date
    May 2005
    Posts
    11

    Default Audit logging

    Thanks Ben. That was exactly what I was looking for !

Similar Threads

  1. Replies: 3
    Last Post: Jun 8th, 2010, 03:27 AM
  2. Forgot password (e.g. secret question) using Acegi
    By lowerymb77 in forum Security
    Replies: 1
    Last Post: Oct 16th, 2005, 10:46 PM
  3. design question: passing context
    By Alarmnummer in forum Management
    Replies: 0
    Last Post: Oct 3rd, 2005, 01:20 PM
  4. Auditing
    By spgarbet in forum Data
    Replies: 5
    Last Post: Feb 23rd, 2005, 08:08 PM
  5. Replies: 6
    Last Post: Oct 8th, 2004, 02:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •