Commit 09ee2129 authored by michael.simon's avatar michael.simon
Browse files

More changes for 2fa and identity

parent c98b05bd
......@@ -32,6 +32,9 @@ public class IdentityEntity extends AbstractBaseEntity {
@Column(name="twofa_user_id", length=512, unique = true)
private String twoFaUserId;
@Column(name="twofa_user_name", length=512, unique = true)
private String twoFaUserName;
@OneToMany(targetEntity=UserEntity.class, mappedBy = "identity")
private Set<UserEntity> users;
......@@ -58,4 +61,12 @@ public class IdentityEntity extends AbstractBaseEntity {
public void setTwoFaUserId(String twoFaUserId) {
this.twoFaUserId = twoFaUserId;
}
public String getTwoFaUserName() {
return twoFaUserName;
}
public void setTwoFaUserName(String twoFaUserName) {
this.twoFaUserName = twoFaUserName;
}
}
......@@ -80,6 +80,7 @@ public class IdentityServiceImpl extends BaseServiceImpl<IdentityEntity, Long> i
if (users.size() == 1) {
for(UserEntity user : users) {
id.setTwoFaUserId(user.getId().toString());
id.setTwoFaUserName(user.getEppn());
}
}
else {
......
......@@ -55,6 +55,10 @@ public class TwoFaConfigurationResolver {
invocable.invokeFunction("resolveConfig", scriptingEnv, configMap, identity, logger);
if (! configMap.containsKey("userId")) {
configMap.put("userId", identity.getTwoFaUserId());
}
return configMap;
} else {
throw new TwoFaConfigurationResolverException("unkown script type: " + scriptEntity.getScriptType());
......
Supports Markdown
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