Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update authorization references (pep -> fad)

...

  1. Configure your repo.xml file

    Add the beans authenticationProvider and pep to your repo.xml file, and make the modeshapeRepofactory bean dependent on authenticationProvider.  Use the class org.fcrepo.auth.ServletContainerAuthenticationProvider as your authentication provider.  Here is an example repo.xml that configures authentication and authorization using the Basic Roles PEPauthorization delegate:

    Code Block
    languagexml
    titlerepo.xml with authentication configured
        <bean name="modeshapeRepofactory"
            class="org.fcrepo.kernel.spring.ModeShapeRepositoryFactoryBean"                                                                                        
            p:repositoryConfiguration="${fcrepo.modeshape.configuration:classpath:/config/rest-sessions/repository.json}"                                          
            depends-on="authenticationProvider"/>                                                                                                                  
                                                                                                                                                                   
        <bean name="pepfad" class="org.fcrepo.auth.roles.basic.BasicRolesPEPBasicRolesAuthorizationDelegate"/>                                                                                       
                                                                                                                                                                   
        <bean name="authenticationProvider" 
    		class="org.fcrepo.auth.common.ServletContainerAuthenticationProvider">                                                        
            <property name="pepfad" ref="pepfad"/>                                                                                                                       
        </bean>
    
    
  2. Configure your repository.json file

    Modify the security section to enable both authenticated (via authentication provider) and internal sessions between Fedora and ModeShape.  It should match this block:

    Code Block
    languageruby
    titlerepository.json security
    "security" : {        
            "anonymous" : {
                "roles" : ["readonly","readwrite","admin"],
                "useOnFailedLogin" : false
            },
            "providers" : [
                { "classname" : "org.fcrepo.auth.common.ServletContainerAuthenticationProvider" }
            ]
        },
  3. Configure your web application container

...