forked from External/mage
Integrate Shiro.
This commit is contained in:
parent
d0ea7d9c37
commit
32b4675f13
5 changed files with 184 additions and 2 deletions
|
|
@ -102,6 +102,17 @@ public class Session {
|
|||
if (m.find()) {
|
||||
return "User name '" + userName + "' includes not allowed characters: use a-z, A-Z and 0-9";
|
||||
}
|
||||
|
||||
AuthorizedUser authorizedUser = AuthorizedUserRepository.instance.get(userName);
|
||||
if (authorizedUser == null) {
|
||||
// Do this in an explicit sign-up flow.
|
||||
AuthorizedUserRepository.instance.add(userName, password);
|
||||
} else {
|
||||
if (!authorizedUser.doCredentialsMatch(userName, password)) {
|
||||
return "Wrong username or password";
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Do an authentication with userName and password.
|
||||
User user = UserManager.getInstance().createUser(userName, host);
|
||||
boolean reconnect = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue