Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ARSnova Backend
Manage
Activity
Members
Labels
Plan
Issues
27
Issue boards
Milestones
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
ARSnova
ARSnova Backend
Commits
d78b8849
Commit
d78b8849
authored
12 years ago
by
Paul-Christian Volkmer
Browse files
Options
Downloads
Patches
Plain Diff
Added logger to log if user logs in with THM or Google-Account
parent
234590c0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pom.xml
+10
-0
10 additions, 0 deletions
pom.xml
src/main/java/de/thm/arsnova/LoginController.java
+8
-1
8 additions, 1 deletion
src/main/java/de/thm/arsnova/LoginController.java
with
18 additions
and
1 deletion
pom.xml
+
10
−
0
View file @
d78b8849
...
@@ -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>
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/thm/arsnova/LoginController.java
+
8
−
1
View file @
d78b8849
...
@@ -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
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment