Users shared now between WebGoat and WebWolf by starting HSQLDB

as standalone database
This commit is contained in:
Nanne Baars
2018-05-01 22:00:07 +02:00
parent 0e160c19f5
commit 6b4a488c8c
8 changed files with 63 additions and 11 deletions

View File

@ -8,6 +8,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -30,7 +31,7 @@ public class MailboxController {
@GetMapping(value = "/WebWolf/mail")
public ModelAndView mail() {
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
UserDetails user = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
ModelAndView modelAndView = new ModelAndView();
List<Email> emails = mailboxRepository.findByRecipientOrderByTimeDesc(user.getUsername());
if (emails != null && !emails.isEmpty()) {

View File

@ -6,7 +6,8 @@ server.port=8081
server.address=127.0.0.1
server.session.cookie.name = WEBWOLFSESSION
spring.datasource.url=jdbc:hsqldb:file:${webgoat.server.directory}/data/webwolf
spring.datasource.url=jdbc:hsqldb:hsql://localhost:9001/webgoat
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.HSQLDialect
spring.jpa.hibernate.ddl-auto=update
spring.messages.basename=i18n/messages

View File

@ -45,7 +45,7 @@
<div class="col-xs-6 col-sm-6 col-md-6">
</div>
</div>
<div><b><a th:href="@{/registration}" th:text="#{register.new}"></a></b></div>
<!--<div><b><a th:href="@{/registration}" th:text="#{register.new}"></a></b></div>-->
</fieldset>
</form>
</div>