Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e46bb972
authored
Dec 08, 2014
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add logging of successfull authentications
1 parent
58284cd7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/beans/JaasBean.java
code/moya-utils/src/main/java/fi/codecrew/moya/utilities/moyamessage/MoyaEventType.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/JaasBean.java
View file @
e46bb97
...
@@ -106,7 +106,7 @@ public class JaasBean implements MoyaRealmBeanRemote {
...
@@ -106,7 +106,7 @@ public class JaasBean implements MoyaRealmBeanRemote {
logger
.
info
(
"logging in as anonymous!!!"
);
logger
.
info
(
"logging in as anonymous!!!"
);
}
else
if
(!
user
.
checkPassword
(
password
))
{
}
else
if
(!
user
.
checkPassword
(
password
))
{
secubean
.
sendMessage
(
MoyaEventType
.
LOGIN_FAILED
,
eventUser
,
"Login failed: wrong password for username "
,
username
);
secubean
.
sendMessage
(
MoyaEventType
.
LOGIN_FAILED
,
eventUser
,
"Login failed: wrong password for username
:
"
,
username
);
eventUser
=
null
;
eventUser
=
null
;
user
=
null
;
user
=
null
;
}
}
...
@@ -125,6 +125,7 @@ public class JaasBean implements MoyaRealmBeanRemote {
...
@@ -125,6 +125,7 @@ public class JaasBean implements MoyaRealmBeanRemote {
eventUserFacade
.
flush
();
eventUserFacade
.
flush
();
eventUser
.
setCreator
(
eventUser
);
eventUser
.
setCreator
(
eventUser
);
}
}
secubean
.
sendMessage
(
MoyaEventType
.
LOGIN_SUCCESSFULL
,
eventUser
,
"User logged in with username: '"
,
username
,
"' eventuser: "
,
eventUser
);
}
else
{
}
else
{
secubean
.
sendMessage
(
MoyaEventType
.
LOGIN_FAILED
,
eventUserFacade
.
findByLogin
(
User
.
ANONYMOUS_LOGINNAME
),
"Login failed: Username not found: "
,
username
);
secubean
.
sendMessage
(
MoyaEventType
.
LOGIN_FAILED
,
eventUserFacade
.
findByLogin
(
User
.
ANONYMOUS_LOGINNAME
),
"Login failed: Username not found: "
,
username
);
}
}
...
@@ -190,7 +191,7 @@ public class JaasBean implements MoyaRealmBeanRemote {
...
@@ -190,7 +191,7 @@ public class JaasBean implements MoyaRealmBeanRemote {
roleset
.
add
(
UserPermission
.
ANYUSER
.
getFullName
());
roleset
.
add
(
UserPermission
.
ANYUSER
.
getFullName
());
if
(
usr
==
null
)
{
if
(
usr
==
null
)
{
usr
=
permbean
.
getAnonEventUser
();
usr
=
permbean
.
getAnonEventUser
();
roleset
.
add
(
SpecialPermission
.
ANONYMOUS
.
name
());
roleset
.
add
(
SpecialPermission
.
ANONYMOUS
.
name
());
}
}
...
...
code/moya-utils/src/main/java/fi/codecrew/moya/utilities/moyamessage/MoyaEventType.java
View file @
e46bb97
...
@@ -11,7 +11,8 @@ public enum MoyaEventType {
...
@@ -11,7 +11,8 @@ public enum MoyaEventType {
BANKING_MESSAGE
(
MoyaEventSource
.
SHOP
),
BANKING_MESSAGE
(
MoyaEventSource
.
SHOP
),
PLACE_ERROR
(
MoyaEventSource
.
PLACEMAP
),
PLACE_ERROR
(
MoyaEventSource
.
PLACEMAP
),
ACCOUNTEVENT_INFO
(
MoyaEventSource
.
USER
),
ACCOUNTEVENT_INFO
(
MoyaEventSource
.
USER
),
USER_PERMISSION_VIOLATION
(
MoyaEventSource
.
USER
),
USER_PERMISSION_VIOLATION
(
MoyaEventSource
.
USER
),
LOGIN_SUCCESSFULL
(
MoyaEventSource
.
USER
),
;
;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment