OpenID AuthenticationHandlerPage edited by Felix MeschbergerChanges (8)
Full ContentOpenID AuthenticationHandler
AuthenticationHandler implementation | AuthenticationHandlerFeedback implementation | Phase 1: Form Submission | Phase 2: Authenticated Requests | Configuration | Integration with Jackrabbit | Security Considerations
The OpenID Authentication Handler supports authentication of request users using the OpenID authentication protocol. If the user has successfully authenticated with his OpenID provider a signed OpenID identity is further used to identify the user. Since generally an OpenID identity is an URL and URLs may not be used as JCR user names, an association mechanism is used by the OpenID authentication handler to associate an OpenID identity with an existing JCR user: The OpenID identity URL is set as the value of a JCR user property. When a user authenticates with his OpenID identity the matching user searched for by looking for a match in this property. NOTE: This association currently only works with Jackrabbit (or Jackrabbit based repositories) because user management is not part of the JCR 2 specification and the OpenID authentication handler uses the Jackrabbit UserManager to find users by a user property value. The OpenID Authentication Handler is maintained in the Sling SVN AuthenticationHandler implementationextractCredentialsrequestCredentialsIf the sling:authRequestLogin parameter is set to a value other than OpenID this method immediately returns false. If the parameter is not set or is set to OpenID this method continues with first invalidating any cached OpenID credentials (same as dropCredentials does) and then redirecting the client to the login form configured with the openid.login.form configuration property. The redirect is provided with up to three request parameters:
dropCredentialsInvalidates the OpenID identity currently stored with the request. This means to either remove the OpenID cookie or to remove the OpenID information from the HTTP Session. This method does not write to the response (except setting the Set-Cookie header to remove the OpenID cookie if required) and does not commit the response. AuthenticationHandlerFeedback implementationauthenticationFailedThis method is called, if the Credentials provided by the Authentication Handler could not be validated by the Jackrabbit authentication infrastructure. One cause may be that the integration with Jackrabbit has not been completed (see Integration with Jackrabbit below). Another, more probably cause, is that the validated OpenID identifier cannot be associated with an existing JCR user. The OpenID Authentication Handler implementation of the authenticationFailed method sets the j_reason request attribute to OpenIDFailure.REPOSITORY and sets the j_openid_identity request attribute to the OpenID identity of the authenticated user. A login form provider may wish to act upon this situation and provide a login form to the user to allow to his OpenID identity with an existing JCR user. In addition, the current OpenID identity is invalidated thus the cached OpenID information is removed from the HTTP Session or the OpenID cookie is cleaned. This will allow the user to present a different OpenID identifier to retry or it will require the OpenID identity to be revalidated with the OpenID provider if the identity is associated with a JCR user. authenticationSucceededThe OpenID Authentication Handler implementation of the authenticationSucceeded method just calls the DefaultAuthenticationFeedbackHandler.handleRedirect method to redirect the user to the initially requested location. Phase 1: Form SubmissionThe form is rendered by redirecting the client to the URL indicated by the form.login.form configuration parameter. This redirection request may accompanyied by the following parameters:
The Form Based Authentication handlers supports the following request parameters submitted by the HTML form:
The OpenID Authentication Handler provides a default login form registered at /system/sling/openid/login. Phase 2: Authenticated RequestsWork in progress .... ConfigurationThe OpenID AuthenticationHandler is configured with configuration provided by the OSGi Configuration Admin Service using the org.apache.sling.openidauth.OpenIdAuthenticationHandler service PID.
Integration with JackrabbitThe OpenID authentication handler can be integrated in two ways into the Jackrabbit authentication mechanism which is based on JAAS LoginModule. One integration is by means of a LoginModulePlugin which plugs into the extensible LoginModule architecture supported by the Sling Jackrabbit Embedded Repository bundle. The other integration option is the trusted_credentials_attribute mechanism supported by the Jackrabbit DefaultLoginModule. By setting the trusted_credentials_attribute parameter of the Jackrabbit DefaultLoginModule and the openid.user.attr configuration property of the OpenID Authentication Handler to the same value, the existence of an attribute of that name in the SimpleCredentials instance provided to the Repository.login method signals pre-authenticated credentials, which need not be further checked by the DefaultLoginModule. Security ConsiderationsWork in progress .... OpenIDAuthentication has some limitations in terms of security:
To prevent eavesdroppers from sniffing the credentials or stealing the Cookie a secure transport layer should be used such as TLS/SSL, VPN or IPSec.
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|
- [CONF] Apache Sling Website > OpenID AuthenticationHandler confluence
- [CONF] Apache Sling Website > OpenID AuthenticationHand... confluence
- [CONF] Apache Sling Website > OpenID AuthenticationHand... confluence
- [CONF] Apache Sling Website > OpenID AuthenticationHand... confluence
- [CONF] Apache Sling Website > OpenID AuthenticationHand... confluence
- [CONF] Apache Sling Website > OpenID AuthenticationHand... confluence
- [CONF] Apache Sling Website > OpenID AuthenticationHand... confluence
- [CONF] Apache Sling Website > OpenID AuthenticationHand... confluence
- [CONF] Apache Sling Website > OpenID AuthenticationHand... confluence
