Este conteúdo não está disponível no idioma selecionado.
17.11. Custom Providers
It is possible to provide your own authentication and authorization logic by providing one (or more) classes that implements the
AuthorizationProvider interface, specifying the names of these classes in the configuration (see below), and making the classes available on the correct classpath.
Implementing the
AuthorizationProvider interface is pretty straightforward. Your class needs a no-arg constructor, and the authenticate method must authenticate the credentials for the named repository and workspace. If the credentials are not authenticated, return null. Otherwise, create an ExecutionContext instance (from the ExecutionContext supplied in the repositoryContext parameter) to contain an appropriate SecurityContext instance for the authenticated user. As mentioned above, the SecurityContext should also implement the AuthorizationProvider interface for non-role-based authorization.