Skip to content
Snippets Groups Projects
Commit d78b8849 authored by Paul-Christian Volkmer's avatar Paul-Christian Volkmer
Browse files

Added logger to log if user logs in with THM or Google-Account

parent 234590c0
Branches
Tags
No related merge requests found
...@@ -81,6 +81,16 @@ ...@@ -81,6 +81,16 @@
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<type>war</type> <type>war</type>
</dependency> </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.6</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
......
...@@ -20,6 +20,8 @@ package de.thm.arsnova; ...@@ -20,6 +20,8 @@ package de.thm.arsnova;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.authentication.encoding.ShaPasswordEncoder; import org.springframework.security.authentication.encoding.ShaPasswordEncoder;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
...@@ -32,6 +34,8 @@ import org.springframework.web.servlet.ModelAndView; ...@@ -32,6 +34,8 @@ import org.springframework.web.servlet.ModelAndView;
@Controller @Controller
public class LoginController { public class LoginController {
public static final Logger logger = LoggerFactory.getLogger(LoginController.class);
@RequestMapping(method = RequestMethod.GET, value = "/doCasLogin") @RequestMapping(method = RequestMethod.GET, value = "/doCasLogin")
public ModelAndView doCasLogin(HttpServletRequest request) { public ModelAndView doCasLogin(HttpServletRequest request) {
String referer = request.getHeader("referer"); String referer = request.getHeader("referer");
...@@ -42,6 +46,8 @@ public class LoginController { ...@@ -42,6 +46,8 @@ public class LoginController {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
User user = (User) authentication.getPrincipal(); User user = (User) authentication.getPrincipal();
logger.info("CAS Login for: " + user.getUsername());
return new ModelAndView("redirect:/" + target + "#auth/checkCasLogin/" + user.getUsername()); return new ModelAndView("redirect:/" + target + "#auth/checkCasLogin/" + user.getUsername());
} }
...@@ -61,7 +67,8 @@ public class LoginController { ...@@ -61,7 +67,8 @@ public class LoginController {
"" ""
); );
} }
logger.info("OpenID Login for user with hash " + userHash);
return new ModelAndView("redirect:/#auth/checkCasLogin/" + userHash); return new ModelAndView("redirect:/#auth/checkCasLogin/" + userHash);
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment