OpenID AuthenticationHandlerPage edited by Felix Meschberger
Comment:
Fix SVN URL (Thanks Steve Tibbett for noting)
Changes (1)
Full ContentOpenID AuthenticationHandlerCredentials Extraction | Phase 1: Form Submission | Configuration | AuthenticationHandler implementation | AuthenticationFeedbackHandler implementation | 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 Credentials ExtractionTheoretically each request with the openid_identifier request parameter set may initiate an OpenID authentication process which involves resolving the OpenID provider for the identifier and subsequently authentication with the provider authorizing the Sling instance to use the OpenID identity. This initiation, though, is not possible if the request already contains a valid and validated OpenID identifier either set as a request attribute or set in the HTTP Session or the OpenID cookie. In these situations, the current association of a client with an OpenID identity must first be removed by logging out, e.g. by requesting /system/sling/logout.html which causes the current OpenID user data to be removed by either removing it from the HTTP Session or by clearing the OpenID cookie. Phase 1: Form SubmissionRequesting an OpenID identifier is initiated by the Sling Authenticator deciding, that authentication is actually required to process a request and the OpenID Authentication Handler being selected to request credentials with. In this case the OpenID authenticator causes a form to be rendered by redirecting the client to the URL indicated by the form.login.form configuration parameter. This redirection request may accompanied by the following parameters:
The OpenID 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. ConfigurationThe OpenID AuthenticationHandler is configured with configuration provided by the OSGi Configuration Admin Service using the org.apache.sling.openidauth.OpenIdAuthenticationHandler service PID.
AuthenticationHandler implementationextractCredentialsTo extract authentication information from the request, the Sling OpenID Authentication handler considers the following information in order:
If the OpenID credentials already exist in the request, they are validated and returned if valid If the existing credentials fail to validate, authentication failure is assumed and the credentials are removed from the request, either by clearing the OpenID cookie or by removing the OpenID User data from the HTTP Session. If no OpenID credentials are found in the request, the request parameter is considered and if set is used to resolve the actual OpenID identity of the user. This involves redirecting the client to the OpenID provider resolved from the OpenID identifier supplied. If the supplied OpenID identifier fails to resolve to an OpenID provider or if the identifier fails to be resolved to a validated OpenID identity, authentication fails. requestCredentialsIf 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. AuthenticationFeedbackHandler 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. 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 ConsiderationsOpenIDAuthentication 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
