You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Nicolas Peltier (Created) (JIRA)" <ji...@apache.org> on 2012/01/02 17:20:31 UTC
[jira] [Created] (SLING-2349) [Authentication] Osgi event creation
for successful login
[Authentication] Osgi event creation for successful login
---------------------------------------------------------
Key: SLING-2349
URL: https://issues.apache.org/jira/browse/SLING-2349
Project: Sling
Issue Type: New Feature
Components: Authentication
Affects Versions: Auth Core 1.0.6
Reporter: Nicolas Peltier
Priority: Minor
Successful authentication (with credentials only?) should create an a "logged in" osgi event mentionning userid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (SLING-2349) [Authentication] Osgi event creation
for successful login
Posted by "Justin Edelson (Resolved) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-2349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Justin Edelson resolved SLING-2349.
-----------------------------------
Resolution: Fixed
> [Authentication] Osgi event creation for successful login
> ---------------------------------------------------------
>
> Key: SLING-2349
> URL: https://issues.apache.org/jira/browse/SLING-2349
> Project: Sling
> Issue Type: New Feature
> Components: Authentication
> Affects Versions: Auth Core 1.0.6
> Reporter: Nicolas Peltier
> Assignee: Justin Edelson
> Priority: Minor
> Fix For: Auth Core 1.1.0
>
> Attachments: SLING-2349-fmeschbe.patch
>
>
> Successful authentication (with credentials only?) should create an a "logged in" osgi event mentionning userid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Reopened] (SLING-2349) [Authentication] Osgi event creation
for successful login
Posted by "Felix Meschberger (Reopened) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-2349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Felix Meschberger reopened SLING-2349:
--------------------------------------
Two notes:
(1) I would not provide the AuthenticationHandler class name. This is an implementation detail we should not expose. Rather I would provide the authentication type, which is really informative (and also provided as HttpServletRequest.getAuthType())
(2) The postLogin event method is probably (not necessarily) not called on first login but for each subsequent request. As such this event generates load on the system and provides no useful information at all in addition to a RequestListener.
The problem with a login event really is, that only an AuthenticationHandler can decide whether provided credentials are for first time login or not. And not even AuthenticationHandlers will always be able to do that: Consider an SSO or HTTP Basic Authentication Handler: Each request comes with the same credentials and there is no clear mark of "this is the first request".
Interestingly, both SSO and HTTP Basic AuthenticationHandler also don't support logout on the Sling level ;-)
All in all, I just can repeat what I already said earlier: I fear it is futile to try to generate distinguished login and logout events because on a generally level of Sling Authentication there is no such thing.
What we might do is provide hooks for authentication handlers to generate the respective events -- if they support such events. So for example, the OpenID authentication handler, knows when the initial OpenID interaction is done and can then send an event. Likewise when dropCredentials is called, the OpenID handler can trigger the logout event.
> [Authentication] Osgi event creation for successful login
> ---------------------------------------------------------
>
> Key: SLING-2349
> URL: https://issues.apache.org/jira/browse/SLING-2349
> Project: Sling
> Issue Type: New Feature
> Components: Authentication
> Affects Versions: Auth Core 1.0.6
> Reporter: Nicolas Peltier
> Assignee: Justin Edelson
> Priority: Minor
> Fix For: Auth Core 1.1.0
>
>
> Successful authentication (with credentials only?) should create an a "logged in" osgi event mentionning userid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (SLING-2349) [Authentication] Osgi event
creation for successful login
Posted by "Felix Meschberger (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-2349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13184779#comment-13184779 ]
Felix Meschberger commented on SLING-2349:
------------------------------------------
re #2: As I understand Nicolas' wish it is about getting an initial event when someone authenticates for the first time. ResourceResolverCreated events are not that useful and I seriously doubt whether Sling Authentication is the appropriate place to fire them (this would rather be the task of the ResourceResolverFactory sending the created event and the ResourceResolver itself sending the closed event when the close() method is called).
I agree, that it might be desirable to have login (when the user first presents credentials) and logout events (when Authenticator.logout() is called). Due to the asynchronous, stateless design of HTTP (and Sling), it is not easy to track the "login event" on a generic basis. So this must, as I said, be left to the AuthenticationHandler and Sling Auth Core might at best provide API to send the login and logout events on behalf of the supporting AuthenticationHandler service.
> [Authentication] Osgi event creation for successful login
> ---------------------------------------------------------
>
> Key: SLING-2349
> URL: https://issues.apache.org/jira/browse/SLING-2349
> Project: Sling
> Issue Type: New Feature
> Components: Authentication
> Affects Versions: Auth Core 1.0.6
> Reporter: Nicolas Peltier
> Assignee: Justin Edelson
> Priority: Minor
> Fix For: Auth Core 1.1.0
>
>
> Successful authentication (with credentials only?) should create an a "logged in" osgi event mentionning userid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (SLING-2349) [Authentication] Osgi event creation
for successful login
Posted by "Justin Edelson (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-2349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Justin Edelson updated SLING-2349:
----------------------------------
Assignee: Justin Edelson
> [Authentication] Osgi event creation for successful login
> ---------------------------------------------------------
>
> Key: SLING-2349
> URL: https://issues.apache.org/jira/browse/SLING-2349
> Project: Sling
> Issue Type: New Feature
> Components: Authentication
> Affects Versions: Auth Core 1.0.6
> Reporter: Nicolas Peltier
> Assignee: Justin Edelson
> Priority: Minor
>
> Successful authentication (with credentials only?) should create an a "logged in" osgi event mentionning userid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (SLING-2349) [Authentication] Osgi event creation
for successful login
Posted by "Felix Meschberger (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-2349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Felix Meschberger updated SLING-2349:
-------------------------------------
Attachment: SLING-2349-fmeschbe.patch
Proposed patch.
I am not 100% sure about the new constant in AuthConstants but it is probably the best compromise in providing new functionality for AuthenticationHandler implementations without invalidating all implementations not interested in these.
> [Authentication] Osgi event creation for successful login
> ---------------------------------------------------------
>
> Key: SLING-2349
> URL: https://issues.apache.org/jira/browse/SLING-2349
> Project: Sling
> Issue Type: New Feature
> Components: Authentication
> Affects Versions: Auth Core 1.0.6
> Reporter: Nicolas Peltier
> Assignee: Justin Edelson
> Priority: Minor
> Fix For: Auth Core 1.1.0
>
> Attachments: SLING-2349-fmeschbe.patch
>
>
> Successful authentication (with credentials only?) should create an a "logged in" osgi event mentionning userid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (SLING-2349) [Authentication] Osgi event
creation for successful login
Posted by "Justin Edelson (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-2349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13183551#comment-13183551 ]
Justin Edelson commented on SLING-2349:
---------------------------------------
added Login and Logout events in r1229715
> [Authentication] Osgi event creation for successful login
> ---------------------------------------------------------
>
> Key: SLING-2349
> URL: https://issues.apache.org/jira/browse/SLING-2349
> Project: Sling
> Issue Type: New Feature
> Components: Authentication
> Affects Versions: Auth Core 1.0.6
> Reporter: Nicolas Peltier
> Assignee: Justin Edelson
> Priority: Minor
> Fix For: Auth Core 1.1.0
>
>
> Successful authentication (with credentials only?) should create an a "logged in" osgi event mentionning userid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Issue Comment Edited] (SLING-2349) [Authentication] Osgi
event creation for successful login
Posted by "Felix Meschberger (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-2349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13184779#comment-13184779 ]
Felix Meschberger edited comment on SLING-2349 at 1/12/12 7:19 AM:
-------------------------------------------------------------------
re #2: As I understand Nicolas' wish it is about getting an initial event when someone authenticates for the first time. ResourceResolverCreated events are not that useful and I seriously doubt whether Sling Authentication is the appropriate place to fire them (this would rather be the task of the ResourceResolverFactory sending the created event and the ResourceResolver itself sending the closed event when the close() method is called).
I agree, that it might be desirable to have login (when the user first presents credentials) and logout events (when Authenticator.logout() is called). Due to the asynchronous, stateless design of HTTP (and Sling), it is not easy to track the "login event" on a generic basis. So this must, as I said, be left to the AuthenticationHandler and Sling Auth Core might at best provide API to send the login and logout events on behalf of the supporting AuthenticationHandler service.
Alternatively: The SlingAuthenticator can decide when to send the logout event since it implements the Authenticator.logout() method. We could add a special AuthInfo property (similar to the AuthenticationFeedbackHandler property) which may be set by an AuthenticationHandler, that the AuthInfo can be considered a LoginInfo, in which case the SingAuthenticator sends the login even after successfully acquiring the ResourceResolver.
was (Author: fmeschbe):
re #2: As I understand Nicolas' wish it is about getting an initial event when someone authenticates for the first time. ResourceResolverCreated events are not that useful and I seriously doubt whether Sling Authentication is the appropriate place to fire them (this would rather be the task of the ResourceResolverFactory sending the created event and the ResourceResolver itself sending the closed event when the close() method is called).
I agree, that it might be desirable to have login (when the user first presents credentials) and logout events (when Authenticator.logout() is called). Due to the asynchronous, stateless design of HTTP (and Sling), it is not easy to track the "login event" on a generic basis. So this must, as I said, be left to the AuthenticationHandler and Sling Auth Core might at best provide API to send the login and logout events on behalf of the supporting AuthenticationHandler service.
> [Authentication] Osgi event creation for successful login
> ---------------------------------------------------------
>
> Key: SLING-2349
> URL: https://issues.apache.org/jira/browse/SLING-2349
> Project: Sling
> Issue Type: New Feature
> Components: Authentication
> Affects Versions: Auth Core 1.0.6
> Reporter: Nicolas Peltier
> Assignee: Justin Edelson
> Priority: Minor
> Fix For: Auth Core 1.1.0
>
>
> Successful authentication (with credentials only?) should create an a "logged in" osgi event mentionning userid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (SLING-2349) [Authentication] Osgi event
creation for successful login
Posted by "Justin Edelson (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-2349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13192833#comment-13192833 ]
Justin Edelson commented on SLING-2349:
---------------------------------------
applied patch more or less as-is in r1235610. Removed logout event. Logout event could be revisited later.
> [Authentication] Osgi event creation for successful login
> ---------------------------------------------------------
>
> Key: SLING-2349
> URL: https://issues.apache.org/jira/browse/SLING-2349
> Project: Sling
> Issue Type: New Feature
> Components: Authentication
> Affects Versions: Auth Core 1.0.6
> Reporter: Nicolas Peltier
> Assignee: Justin Edelson
> Priority: Minor
> Fix For: Auth Core 1.1.0
>
> Attachments: SLING-2349-fmeschbe.patch
>
>
> Successful authentication (with credentials only?) should create an a "logged in" osgi event mentionning userid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (SLING-2349) [Authentication] Osgi event
creation for successful login
Posted by "Justin Edelson (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-2349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13184199#comment-13184199 ]
Justin Edelson commented on SLING-2349:
---------------------------------------
re: #1, good point. this is done in r1230154
re: #2, I'd contemplated calling the login event "ResourceResolverCreated" as that's really the intent.
Regarding load, this warrants testing. My expectation is that the impact would be minimal if there were no listeners for these events.
> [Authentication] Osgi event creation for successful login
> ---------------------------------------------------------
>
> Key: SLING-2349
> URL: https://issues.apache.org/jira/browse/SLING-2349
> Project: Sling
> Issue Type: New Feature
> Components: Authentication
> Affects Versions: Auth Core 1.0.6
> Reporter: Nicolas Peltier
> Assignee: Justin Edelson
> Priority: Minor
> Fix For: Auth Core 1.1.0
>
>
> Successful authentication (with credentials only?) should create an a "logged in" osgi event mentionning userid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (SLING-2349) [Authentication] Osgi event creation
for successful login
Posted by "Justin Edelson (Resolved) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-2349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Justin Edelson resolved SLING-2349.
-----------------------------------
Resolution: Fixed
Fix Version/s: Auth Core 1.1.0
> [Authentication] Osgi event creation for successful login
> ---------------------------------------------------------
>
> Key: SLING-2349
> URL: https://issues.apache.org/jira/browse/SLING-2349
> Project: Sling
> Issue Type: New Feature
> Components: Authentication
> Affects Versions: Auth Core 1.0.6
> Reporter: Nicolas Peltier
> Assignee: Justin Edelson
> Priority: Minor
> Fix For: Auth Core 1.1.0
>
>
> Successful authentication (with credentials only?) should create an a "logged in" osgi event mentionning userid.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira