Permalink
Browse files

- added loginservice

  • Loading branch information...
1 parent 0c86aaf commit b14e186352809d7dee5e31735d3748838c2bd70b @mdasberg committed Jan 26, 2012
Showing with 74 additions and 0 deletions.
  1. +11 −0 web/pom.xml
  2. +48 −0 web/src/main/java/nl/jpoint/top2k/jetty/Top2KLoginService.java
  3. +15 −0 web/src/main/webapp/WEB-INF/web.xml
View
@@ -29,13 +29,24 @@
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
+ <loginServices>
+ <loginService implementation="nl.jpoint.top2k.jetty.Top2KLoginService">
+ <name>dnt2000</name>
+ </loginService>
+ </loginServices>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-security</artifactId>
+ <version>8.1.0.RC5</version>
+ </dependency>
+
+ <dependency>
<groupId>nl.jpoint.top2k</groupId>
<artifactId>domain</artifactId>
</dependency>
@@ -0,0 +1,48 @@
+package nl.jpoint.top2k.jetty;
+
+import org.eclipse.jetty.security.IdentityService;
+import org.eclipse.jetty.security.LoginService;
+import org.eclipse.jetty.server.UserIdentity;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: misha
+ * Date: 26-01-12
+ * Time: 20:40
+ * To change this template use File | Settings | File Templates.
+ */
+public class Top2KLoginService implements LoginService {
+
+ public Top2KLoginService() {
+ }
+
+ @Override
+ public String getName() {
+ return "dnt2000"; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ @Override
+ public UserIdentity login(String s, Object o) {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ @Override
+ public boolean validate(UserIdentity userIdentity) {
+ return false; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ @Override
+ public IdentityService getIdentityService() {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ @Override
+ public void setIdentityService(IdentityService identityService) {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ @Override
+ public void logout(UserIdentity userIdentity) {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+}
@@ -18,4 +18,19 @@
<filter-name>guiceFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>restricted</web-resource-name>
+ <url-pattern>/rest/*</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>admin</role-name>
+ </auth-constraint>
+ </security-constraint>
+
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ <realm-name>dnt2000</realm-name>
+ </login-config>
</web-app>

0 comments on commit b14e186

Please sign in to comment.