You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Michael Hartmeier <Mi...@softwareag.com> on 2004/01/06 11:07:11 UTC
Re: servlet context or session object from store
I'm not the security expert in our group, but I can describe how we
access the principal: We wrote a SecurtiyStore which implements
connect like this:
public synchronized void connect(CredentialsToken credentialsToken)
throws ServiceConnectionFailedException
{
Store store;
if (isConnected()) {
// Slide issues multiple connect call for the same store in
the same
// thread. We process only the first
return;
}
if (credentialsToken != null) {
principal = credentialsToken.getPrincipal();
} else {
// no suitable credentials to connect -- do nothing
}
[store principal "ThreadLocal"]
}
Principal has to be stored "ThreadLocal" because there are different
credentialsTokens for different requests ...
Michael
On Sat, 2003-12-20 at 16:57, Mike Oliver wrote:
> Gents,
>
> I could use a hand, I cannot find a way to get at the servlet context
> or
> session object to get user information from my custom store I am
> extending the AbstractTxFileStoreService.
>
> I have already looked at all (or at least I think I have) the
> properties
> and methods of all the complex objects passed to all the methods and I
> cannot see any sort of method or reference to get at this info....but
> it
> is illogical to me that the Store doesn't know who the user is, so I
> know I am missing something.
>
> Please point me in the right direction!
>
> Ollie
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org
Re: servlet context or session object from store
Posted by Mike Oliver <ol...@matrix-media.com>.
I see so your custom store implements SecurityStore as well as NodeStore
and ContentStore and "principal" is a member variable?
Ollie
Michael Hartmeier wrote:
>I'm not the security expert in our group, but I can describe how we
>access the principal: We wrote a SecurtiyStore which implements
>connect like this:
>
> public synchronized void connect(CredentialsToken credentialsToken)
> throws ServiceConnectionFailedException
> {
> Store store;
>
> if (isConnected()) {
> // Slide issues multiple connect call for the same store in
>the same
> // thread. We process only the first
> return;
> }
> if (credentialsToken != null) {
> principal = credentialsToken.getPrincipal();
> } else {
> // no suitable credentials to connect -- do nothing
> }
>
> [store principal "ThreadLocal"]
> }
>
>Principal has to be stored "ThreadLocal" because there are different
>credentialsTokens for different requests ...
>
>Michael
>
>On Sat, 2003-12-20 at 16:57, Mike Oliver wrote:
>
>
>>Gents,
>>
>>I could use a hand, I cannot find a way to get at the servlet context
>>or
>>session object to get user information from my custom store I am
>>extending the AbstractTxFileStoreService.
>>
>>I have already looked at all (or at least I think I have) the
>>properties
>>and methods of all the complex objects passed to all the methods and I
>>cannot see any sort of method or reference to get at this info....but
>>it
>>is illogical to me that the Store doesn't know who the user is, so I
>>know I am missing something.
>>
>>Please point me in the right direction!
>>
>>Ollie
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: slide-dev-help@jakarta.apache.org
>>
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: slide-dev-help@jakarta.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org