CAS Part 1

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
2020-12-03 16:23:39 +01:00
parent b6c2e43975
commit 3ebfda5316
5 changed files with 56 additions and 9 deletions

View File

@ -49,13 +49,5 @@ public class App {
mac.setSurname("Głowacki");
mac.setRole(UserRoles.STUDENT);
this.userService.save(mac);
User mar = new User();
mar.setEmail("marwoz16@st.amu.edu.pl");
mar.setName("Marcin");
mar.setSurname("Woźniak");
mar.setRole(UserRoles.ADMIN);
this.userService.save(mar);
}
}

View File

@ -36,7 +36,9 @@ public class TokenController {
try {
CasUserIdentity casUserIdentity = validator.validate();
String authority = casUserIdentity.getEmail();
String usosId = casUserIdentity.getUsosId();
String authority = casUserIdentity.getEmail();
this.userService.checkForUser(authority, usosId);
String token = this.userService.login(authority);
return new ResponseEntity<>(token, HttpStatus.OK);
} catch (CasValidationExcepiton e) {