Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please log the current logged user when denying access #2

Open
Feandil opened this issue Jan 24, 2014 · 0 comments
Open

Please log the current logged user when denying access #2

Feandil opened this issue Jan 24, 2014 · 0 comments

Comments

@Feandil
Copy link

Feandil commented Jan 24, 2014

The current code logs things like this:

2014-01-22 23:04:20.467Z - INFO [InitSecurityContext] - Connection from .....
2014-01-22 23:04:20.475Z - INFO [BasePAPOperation] - Insufficient privileges to perform operation 'GetPoliciesForPAPOperation'
2014-01-22 23:04:20.475Z - ERROR [ProvisioningService] - Insufficient privileges to perform operation 'GetPoliciesForPAPOperation'.

When more than one user is connected, there is no way to know which one is denied. Looking in the code, the function that should be modified is in src/main/java/org/glite/authz/pap/authz/BasePAPOperation.java:

    public final T execute() {

        logOperation();

        if ( !isAllowed() ) {

            log.info( "Insufficient privileges to perform operation '"
                    + getName() + "'" );

            throw new PAPAuthzException(
                    "Insufficient privileges to perform operation '"
                            + getName() + "'." );
        }

        return doExecute();
    }

As far as I understand the code (not really ...), the current logged user could be obtained via 'CurrentAdmin admin = CurrentAdmin.instance();' or directly something like what is in CurrentAdmin (SecurityContext theContext = SecurityContext.getCurrentContext(); String adminDN = theContext.getClientName();)'. I don't know how to format correctly the output...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant