From 9bdedd0eff6ed93c43d8a8685d2322474916baa8 Mon Sep 17 00:00:00 2001
From: Bruce Mayhew In this case only localhost, ip1 and ip2 are permitted to connect.
-WebGoat requires the following users and roles to be configured in order for the application to run.
+WebGoat uses spring-security.xml to configure users.
WebGoat Default Users and Roles for Tomcat
+Configuring new WebGoat users
- >role rolename="webgoat_basic"/<
- >role rolename="webgoat_admin"/<
- >role rolename="webgoat_user"/<
- >user username="webgoat" password="webgoat" roles="webgoat_admin"/<
- >user username="basic" password="basic" roles="webgoat_user,webgoat_basic"/<
- >user username="guest" password="guest" roles="webgoat_user"/<
+ <!-- Authentication Manager -->
+ <authentication-manager alias="authenticationManager">
+ <authentication-provider>
+ <user-service>
+ <!-- TODO: credentials in the config - this isn't something I'm proud of - get rid of this ASAP -->
+ <user name="guest" password="guest" authorities="ROLE_WEBGOAT_USER" />
+ <user name="webgoat" password="webgoat" authorities="ROLE_WEBGOAT_ADMIN" />
+ <user name="server" password="server" authorities="ROLE_SERVER_ADMIN" />
+ </user-service>
+ </authentication-provider>
+ </authentication-manager>
Adding a user is straight forward. You can use the guest entry as an example. The added -users should have the same role as the guest user. Add lines like this to the file: +users should have the same role as the guest user. The new user/password will not show on the login page. +Add lines like this to the file:
- <user name="student1" password="password1" roles="webgoat_user"/> - <user name="student2" password="password2" roles="webgoat_user"/> + <user name="guest2" password="guest2" authorities="ROLE_WEBGOAT_USER" /> ...