|
This post has NOT been accepted by the mailing list yet.
This post was updated on .
public class CtfButtonBar implements NexusIndexHtmlCustomizer {
@Override
public String getPostBodyContribution( Map<String, Object> context )
{
Here I use the query string from the request object and do some communication
with another application running outside and get ready with an object called
integratedAppObject.
I need this "integratedAppObject" while authentication in CTFAuthenticationRealm clas ( which extends AuthorizingRealm and implements Realm ) .
so i set this object integratedAppObject in class A. so that I can access this class elsewhere .
}
}
@Component( role = Realm.class, hint = "CTFAuthenticationRealm", description = "Teamforge Authenticating Realm" )
public class CTFAuthenticationRealm extends AuthorizingRealm implements Realm{
@Override
protected AuthorizationInfo doGetAuthorizationInfo( final PrincipalCollection principals )
{
Here I access class A and get the integratedAppObject .and decide what roles to give
for the user .
}
}
so now the above explained process happens for each and every user . now when user A logs in this process happens smoothly .
then when user B logs in this process here too happens smoothly .
But now in the browser where user A is there if I try to open say "repository" tab by clicking it in the side pane of nexus screen , nexus immediately calls doGetAuthorizationInfo in CTFAuthenticationRealm (I witnessed this while debugging) . so now what happens is that the integratedAppObject is that of user B's .so now user A role allocation happens using user B's integratedAppObject .so this is wrong and results in wrong behaviour in UI .
so it is clear that some where I need to have this integratedAppObject stored and when the logged in(already logged in) user's role is checked I should use the correct integratedAppObject .Does nexus provide this provision ?
If nexus provides login facility by providing their own realm , anyone would expect it to provide provision were we can store such objects .
If not what can be the solution in such a case .
Note: I cannot prepare the integratedAppObject again and again . so I have to reuse it for each user.
Please help
|