Skip to content

Commit

Permalink
Merge pull request #33 from projecthydra/authorization
Browse files Browse the repository at this point in the history
Enabling basic authorization for Fedora
  • Loading branch information
carolyncole committed Feb 19, 2015
2 parents 9e80189 + bc2a4b1 commit c28d6d1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ When jetty is finished initializing itself, Solr is available at
and Fedora is available at

* [http://localhost:8983/fedora/](http://localhost:8983/fedora/)
* basic authorization is enabled an requires the username/password `fedoraAdmin/fedoraAdmin`
* this is configured under [jetty-users.properties](resources/jetty-users.properties)

You can see a list of all installed applications at

Expand Down
10 changes: 10 additions & 0 deletions contexts/fedora.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,14 @@
<Set name="contextPath">/fedora</Set>
<Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/fedora.war</Set>
<Set name="overrideDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/fedora-override-web.xml</Set>

<Get name="securityHandler">
<Set name="loginService">
<New class="org.eclipse.jetty.security.HashLoginService">
<Set name="name">fcrepo4</Set>
<Set name="config"><SystemProperty name="jetty.home" default="."/>/resources/jetty-users.properties</Set>
</New>
</Set>
</Get>

</Configure>
4 changes: 0 additions & 4 deletions etc/fedora-override-web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@

</servlet-mapping>

<!--Uncomment section below to enable Basic-Authentication-->
<!--
<security-constraint>
<web-resource-collection>
<web-resource-name>Fedora4</web-resource-name>
Expand All @@ -62,7 +60,5 @@
<auth-method>BASIC</auth-method>
<realm-name>fcrepo</realm-name>
</login-config>
-->


</web-app>
7 changes: 7 additions & 0 deletions resources/jetty-users.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Fedora users and passwords. Each line corresponds to:
#
# username: password, role
#
# Where role is either fedoraUser or fedoraAdmin as outlined in contexts/fedora.xml
fedoraUser: fedoraUser,fedoraUser
fedoraAdmin: fedoraAdmin,fedoraAdmin

0 comments on commit c28d6d1

Please sign in to comment.