此内容没有您所选择的语言版本。
17.10. Available Security Providers
ModeShape comes with several
AuthorizationProvider implementations that are automatically configured with every Repository, depending upon other settings and options. These providers are as follows:
JaasProvideruses JAAS for all authentication and role-based authorization. This provider authenticates clients that login to the Repository with aSimpleCredentialsobject, where the username and password match that in the JAAS policy, or aJaasCredentialsconstructed with a specific and already-authenticated JAASLoginContext. This provider can be disabled by setting the jaasLoginConfigName configuration options to an empty (i.e., zero-length) value; otherwise, the option defines the name of the JAAS login configuration and will default to "modeshape-jcr" if not explicitly set. (This provider also works in some J2EE containers, in which the JAAS Subject is not available via the standard JAAS API and instead requires use of the JACC API, which many J2EE containers support)SeamSecurityProviderdelegates all authentication and role-based authorization to the Seam Security framework. This provider authenticates clients that login to the Repository with no need to pass aCredentialsobject. Note this does require obtaining a session for each servlet request, which is actually how the JCR API was intended to be used within web applications. This provider is automatically enabled when the Seam Security Identity class is found on the classpath.ServletProviderdelegates all authentication and role-based authorization to the servlet framework. This provider authenticates clients that login to the Repository with aServletCredentialsobject, which can be constructed with theHttpServletRequest. Note this does require obtaining a session for each servlet request, which is actually how the JCR API was intended to be used within web applications. This provider is automatically enabled when the HttpServletSession class is found on the classpath.AnonymousProviderwill allow clients without Credentials to operate upon the repository, and will use role-based authorization based upon the roles defined by the anonymousUserRoles configuration option. This provider authenticates clients that provide anAnonymousCredentialsto the Repository 'slogin(...)methods or use one of thelogin(...)methods that does not take a Credentials object.
Note
The
SecurityContextProvider is also configured only when the useSecurityContextCredentials configuration option is set to 'true'. This provider authenticates clients that pass a SecurityContextCredentials object, and delegates all authentication to the embedded SecurityContext. This deprecated approach not enabled by default, and will be removed in the next major release of ModeShape. It remains in place to enable applications that use this approach to upgrade to ModeShape 2.6 (or later) without breaking their authentication mechanism.