Outh working!. Pending:

- Test all databases
- Migration Scripts
- Manage error due to changing of authentication schemas.
- Link from the login page.
- What happend with the logout ?.
This commit is contained in:
Paulo Gustavo Veiga
2013-03-17 18:51:33 -03:00
parent 2f8df725c9
commit 94356a5773
13 changed files with 113 additions and 40 deletions

View File

@@ -20,6 +20,7 @@ package com.wisemapping.security;
import com.wisemapping.exceptions.WiseMappingException;
import com.wisemapping.model.AuthenticationSchema;
import com.wisemapping.model.User;
import com.wisemapping.service.UserService;
import org.jetbrains.annotations.NotNull;
@@ -62,6 +63,7 @@ public class UserDetailsService
result = dbUser;
} else {
try {
tUser.setAuthenticationSchema(AuthenticationSchema.OPENID);
result = userService.createUser(tUser, false, false);
} catch (WiseMappingException e) {
throw new IllegalStateException(e);

View File

@@ -2,6 +2,7 @@ package com.wisemapping.security.ldap;
import com.wisemapping.exceptions.WiseMappingException;
import com.wisemapping.model.AuthenticationSchema;
import com.wisemapping.model.User;
import com.wisemapping.security.UserDetails;
import com.wisemapping.service.UserService;
@@ -64,6 +65,7 @@ public class LdapUserDetailsContextMapper implements UserDetailsContextMapper {
user.setActivationDate(now);
try {
user.setAuthenticationSchema(AuthenticationSchema.LDAP);
user = userService.createUser(user, false, false);
} catch (WiseMappingException e) {
throw new IllegalStateException(e);