You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Jos Snellings <Jo...@pandora.be> on 2010/06/02 06:12:34 UTC
authentication against trusted party
Dear,
I am confronted with the following use cases:
1. sling app needs to authenticate with a nearby (same server) webapp.
No anonymous access allowed.
=> I created 'proxyauthenticator' for this:
* anonymous requests are forwarded to the trused webapps
login
* trusted webapp places short (30 sec) session entry in
a shared DB table upon
successful login
* trusted webapp causes authenticated web client to
request menu options from
sling app with this short session ID
* proxyauthenticator picks this ID up, authenticates the
user, and clears the entry from the table
2. sling app needs to authenticate with organisation's LDAP server
I have following questions:
- for proxyAuthenticationHandler, is it alright if extractCredentials
calls requestCredentials directly if no
valid credentials exist in the session?
- proxyauthenticator is being written as a proof of concept, is there
interest in adopting it in the sling trunk after peer review?
- these two 'trusted party' authentication mechanisms, are about the
mechanism only. SlingAuthenticator's
handleSecurity will inevitably try to get a JCR session for the
provided credentials... and this brings a complication:
the account must exist locally in the JCR repository.
Is there a way to obtain an even tighter integration? Would that
imply a sort of synchronisation between the accounts on
trusted app and sling app?
Thank you so much for your thoughts,
Jos
Re: authentication against trusted party
Posted by Felix Meschberger <fm...@gmail.com>.
Hi,
On 02.06.2010 10:39, Jos Snellings wrote:
> Thank you for your very informative reply, Felix.
> I understand openID, but this is not what I need to do. My use case is:
> the customer organisation has a number of user accounts. They are in
> a web application. My customer does not use openID and does not want to.
> In order for my solution to be accepted it must work with that existing
> mechanism,
> and this integration must be really tight, even seamless.
ok. then you certainly could do that with a Sling AuthenticationHandler.
What I suggest to add in some "caching" (e.g. a cookie or so) to not
have to redirect the user on each request. To then actually access the
repository, you could do a PluggableLoginModule or leverage the "trusted
credentials" functionality of the Jackrabbit DefaultLoginModule.
BTW: of course we would be very interested in hearing about your user story.
>
> As for with LDAP, I follow you in that a Login module is best, and, I
> think,
> based upon earlier experience the sync between JackRabbit user base and
> LDAP would best happen on demand.
>
> As for the second solution: authenticationHandler should look up if the
> account exist,
> and create it if it does not: at that point, would the thread executing
> this code have
> the necessary privileges to insert a new user?
If the authentication handler gets an administrative session
(independent of the actual request), that session could be used to
synchronize the user.
Regards
Felix
>
> Cheers,
> Jos
>
> On 06/02/2010 09:57 AM, Felix Meschberger wrote:
>> Hi,
>>
>> On 02.06.2010 06:12, Jos Snellings wrote:
>>
>>> Dear,
>>>
>>> I am confronted with the following use cases:
>>> 1. sling app needs to authenticate with a nearby (same server) webapp.
>>> No anonymous access allowed.
>>> => I created 'proxyauthenticator' for this:
>>> * anonymous requests are forwarded to the trused webapps
>>> login
>>> * trusted webapp places short (30 sec) session entry
>>> in a
>>> shared DB table upon
>>> successful login
>>> * trusted webapp causes authenticated web client to
>>> request menu options from
>>> sling app with this short session ID
>>> * proxyauthenticator picks this ID up, authenticates the
>>> user, and clears the entry from the table
>>>
>> Looks like you try to reinvent OpenID. How about implementing an OpenID
>> provider on the "trusted webapp" server ?
>>
>>
>>> 2. sling app needs to authenticate with organisation's LDAP server
>>>
>>> I have following questions:
>>> - for proxyAuthenticationHandler, is it alright if extractCredentials
>>> calls requestCredentials directly if no
>>> valid credentials exist in the session?
>>>
>> Yes, in this case extractCredentials should return
>> AuthenticationInfo.DOING_AUTH to indicate credentials have already been
>> requested.
>>
>> Yet, I would probably not do so but rather have the SlingAuthenticator
>> first try to find another authentication handler and only if none
>> provide credentials have the SlingAuthenticator select an authentication
>> handler and call its requestCredentials method.
>>
>>
>>> - proxyauthenticator is being written as a proof of concept, is there
>>> interest in adopting it in the sling trunk after peer review?
>>>
>> If its just duplicating OpenID functionality, we would have to see. If
>> it is a real LDAP-based authentication handler, most probably yes; but
>> see below for more flesh to the LDAP-bone.
>>
>>
>>> - these two 'trusted party' authentication mechanisms, are about the
>>> mechanism only. SlingAuthenticator's
>>> handleSecurity will inevitably try to get a JCR session for the
>>> provided credentials... and this brings a complication:
>>> the account must exist locally in the JCR repository.
>>> Is there a way to obtain an even tighter integration? Would that
>>> imply
>>> a sort of synchronisation between the accounts on
>>> trusted app and sling app?
>>>
>> Yes, definitely so and there are multiple options.
>>
>> One option (which we at Day chose for integration of LDAP servers with
>> Day's CRX product) is to actually implement a Jackrabbit LoginModule
>> which is able to synchronize the user base with the LDAP server
>> on-demand. This LoginModule will (1) authenticate the Credentials with
>> the LDAP server (generally doing an LDAP bind) and (2) will
>> automatically create a local JCR Repository used based on data requested
>> from the LDAP server.
>>
>> In fact, doing an LDAP LoginModule, would allow Sling to not require
>> contacting the authenication server at all. Instead you could use the
>> normal form based login handler which provides user name and password in
>> the JCR Credentials to the repository where the repository will then use
>> these credentials to check with the LDAP server.
>>
>> The other option would be to have the Sling authentication handler
>> validate the credentials with the LDAP server (e.g. using LDAP bind) and
>> use Jackrabbit user management functionality to create the users on
>> demand if need be. This login handler would then have to use the
>> "trusted credentials" mechanism also used by the OpenID login module to
>> authenticate with the repository.
>>
>> For the LDAP case, I would actually prefer the first option of writing a
>> LoginModule able to synchronize with the LDAP server on-demand.
>>
>> Hope this helps.
>>
>> Regards
>> Felix
>>
>>
>>
>
>
Re: authentication against trusted party
Posted by Jos Snellings <Jo...@pandora.be>.
Thank you for your very informative reply, Felix.
I understand openID, but this is not what I need to do. My use case is:
the customer organisation has a number of user accounts. They are in
a web application. My customer does not use openID and does not want to.
In order for my solution to be accepted it must work with that existing
mechanism,
and this integration must be really tight, even seamless.
As for with LDAP, I follow you in that a Login module is best, and, I
think,
based upon earlier experience the sync between JackRabbit user base and
LDAP would best happen on demand.
As for the second solution: authenticationHandler should look up if the
account exist,
and create it if it does not: at that point, would the thread executing
this code have
the necessary privileges to insert a new user?
Cheers,
Jos
On 06/02/2010 09:57 AM, Felix Meschberger wrote:
> Hi,
>
> On 02.06.2010 06:12, Jos Snellings wrote:
>
>> Dear,
>>
>> I am confronted with the following use cases:
>> 1. sling app needs to authenticate with a nearby (same server) webapp.
>> No anonymous access allowed.
>> => I created 'proxyauthenticator' for this:
>> * anonymous requests are forwarded to the trused webapps
>> login
>> * trusted webapp places short (30 sec) session entry in a
>> shared DB table upon
>> successful login
>> * trusted webapp causes authenticated web client to
>> request menu options from
>> sling app with this short session ID
>> * proxyauthenticator picks this ID up, authenticates the
>> user, and clears the entry from the table
>>
> Looks like you try to reinvent OpenID. How about implementing an OpenID
> provider on the "trusted webapp" server ?
>
>
>> 2. sling app needs to authenticate with organisation's LDAP server
>>
>> I have following questions:
>> - for proxyAuthenticationHandler, is it alright if extractCredentials
>> calls requestCredentials directly if no
>> valid credentials exist in the session?
>>
> Yes, in this case extractCredentials should return
> AuthenticationInfo.DOING_AUTH to indicate credentials have already been
> requested.
>
> Yet, I would probably not do so but rather have the SlingAuthenticator
> first try to find another authentication handler and only if none
> provide credentials have the SlingAuthenticator select an authentication
> handler and call its requestCredentials method.
>
>
>> - proxyauthenticator is being written as a proof of concept, is there
>> interest in adopting it in the sling trunk after peer review?
>>
> If its just duplicating OpenID functionality, we would have to see. If
> it is a real LDAP-based authentication handler, most probably yes; but
> see below for more flesh to the LDAP-bone.
>
>
>> - these two 'trusted party' authentication mechanisms, are about the
>> mechanism only. SlingAuthenticator's
>> handleSecurity will inevitably try to get a JCR session for the
>> provided credentials... and this brings a complication:
>> the account must exist locally in the JCR repository.
>> Is there a way to obtain an even tighter integration? Would that imply
>> a sort of synchronisation between the accounts on
>> trusted app and sling app?
>>
> Yes, definitely so and there are multiple options.
>
> One option (which we at Day chose for integration of LDAP servers with
> Day's CRX product) is to actually implement a Jackrabbit LoginModule
> which is able to synchronize the user base with the LDAP server
> on-demand. This LoginModule will (1) authenticate the Credentials with
> the LDAP server (generally doing an LDAP bind) and (2) will
> automatically create a local JCR Repository used based on data requested
> from the LDAP server.
>
> In fact, doing an LDAP LoginModule, would allow Sling to not require
> contacting the authenication server at all. Instead you could use the
> normal form based login handler which provides user name and password in
> the JCR Credentials to the repository where the repository will then use
> these credentials to check with the LDAP server.
>
> The other option would be to have the Sling authentication handler
> validate the credentials with the LDAP server (e.g. using LDAP bind) and
> use Jackrabbit user management functionality to create the users on
> demand if need be. This login handler would then have to use the
> "trusted credentials" mechanism also used by the OpenID login module to
> authenticate with the repository.
>
> For the LDAP case, I would actually prefer the first option of writing a
> LoginModule able to synchronize with the LDAP server on-demand.
>
> Hope this helps.
>
> Regards
> Felix
>
>
>
Re: authentication against trusted party
Posted by Felix Meschberger <fm...@gmail.com>.
Hi,
On 02.06.2010 06:12, Jos Snellings wrote:
> Dear,
>
> I am confronted with the following use cases:
> 1. sling app needs to authenticate with a nearby (same server) webapp.
> No anonymous access allowed.
> => I created 'proxyauthenticator' for this:
> * anonymous requests are forwarded to the trused webapps
> login
> * trusted webapp places short (30 sec) session entry in a
> shared DB table upon
> successful login
> * trusted webapp causes authenticated web client to
> request menu options from
> sling app with this short session ID
> * proxyauthenticator picks this ID up, authenticates the
> user, and clears the entry from the table
Looks like you try to reinvent OpenID. How about implementing an OpenID
provider on the "trusted webapp" server ?
>
> 2. sling app needs to authenticate with organisation's LDAP server
>
> I have following questions:
> - for proxyAuthenticationHandler, is it alright if extractCredentials
> calls requestCredentials directly if no
> valid credentials exist in the session?
Yes, in this case extractCredentials should return
AuthenticationInfo.DOING_AUTH to indicate credentials have already been
requested.
Yet, I would probably not do so but rather have the SlingAuthenticator
first try to find another authentication handler and only if none
provide credentials have the SlingAuthenticator select an authentication
handler and call its requestCredentials method.
> - proxyauthenticator is being written as a proof of concept, is there
> interest in adopting it in the sling trunk after peer review?
If its just duplicating OpenID functionality, we would have to see. If
it is a real LDAP-based authentication handler, most probably yes; but
see below for more flesh to the LDAP-bone.
> - these two 'trusted party' authentication mechanisms, are about the
> mechanism only. SlingAuthenticator's
> handleSecurity will inevitably try to get a JCR session for the
> provided credentials... and this brings a complication:
> the account must exist locally in the JCR repository.
> Is there a way to obtain an even tighter integration? Would that imply
> a sort of synchronisation between the accounts on
> trusted app and sling app?
Yes, definitely so and there are multiple options.
One option (which we at Day chose for integration of LDAP servers with
Day's CRX product) is to actually implement a Jackrabbit LoginModule
which is able to synchronize the user base with the LDAP server
on-demand. This LoginModule will (1) authenticate the Credentials with
the LDAP server (generally doing an LDAP bind) and (2) will
automatically create a local JCR Repository used based on data requested
from the LDAP server.
In fact, doing an LDAP LoginModule, would allow Sling to not require
contacting the authenication server at all. Instead you could use the
normal form based login handler which provides user name and password in
the JCR Credentials to the repository where the repository will then use
these credentials to check with the LDAP server.
The other option would be to have the Sling authentication handler
validate the credentials with the LDAP server (e.g. using LDAP bind) and
use Jackrabbit user management functionality to create the users on
demand if need be. This login handler would then have to use the
"trusted credentials" mechanism also used by the OpenID login module to
authenticate with the repository.
For the LDAP case, I would actually prefer the first option of writing a
LoginModule able to synchronize with the LDAP server on-demand.
Hope this helps.
Regards
Felix