Commit 8d3c8c70 authored by michael.simon's avatar michael.simon
Browse files

correctly save oidc attribute map on first visit

create some text properties
parent 5f6916ff
......@@ -15,6 +15,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
import javax.ejb.Stateless;
......@@ -45,6 +46,7 @@ import edu.kit.scc.webreg.event.EventSubmitter;
import edu.kit.scc.webreg.event.UserEvent;
import edu.kit.scc.webreg.exc.EventSubmitException;
import edu.kit.scc.webreg.exc.UserUpdateException;
import edu.kit.scc.webreg.service.impl.AttributeMapHelper;
@Stateless
public class OidcUserCreateServiceImpl implements OidcUserCreateService {
......@@ -87,7 +89,10 @@ public class OidcUserCreateServiceImpl implements OidcUserCreateService {
@Inject
private OidcGroupUpdater oidcGroupUpdater;
@Inject
private AttributeMapHelper attrHelper;
@Override
public OidcUserEntity preCreateUser(Long rpConfigId,
String locale, Map<String, List<Object>> attributeMap)
......@@ -220,10 +225,10 @@ public class OidcUserCreateServiceImpl implements OidcUserCreateService {
logger.info("Setting UID Number {} for user {}", user.getUidNumber(), user.getEppn());
}
// Map<String, String> attributeStore = user.getAttributeStore();
// for (Entry<String, List<Object>> entry : attributeMap.entrySet()) {
// attributeStore.put(entry.getKey(), attrHelper.attributeListToString(entry.getValue()));
// }
Map<String, String> attributeStore = user.getAttributeStore();
for (Entry<String, List<Object>> entry : attributeMap.entrySet()) {
attributeStore.put(entry.getKey(), attrHelper.attributeListToString(entry.getValue()));
}
user.setLastUpdate(new Date());
......
......@@ -160,6 +160,22 @@ public class RegisterUserBean implements Serializable {
printableAttributesList.add("epuid");
printableAttributesMap.put("epuid", attrHelper.attributeListToString(entry.getValue(), ", "));
}
else if (entry.getKey().equals("urn:oasis:names:tc:SAML:attribute:pairwise-id")){
printableAttributesList.add("pairwise_id");
printableAttributesMap.put("pairwise_id", attrHelper.attributeListToString(entry.getValue(), ", "));
}
else if (entry.getKey().equals("urn:oasis:names:tc:SAML:attribute:subject-id")){
printableAttributesList.add("subject_id");
printableAttributesMap.put("subject_id", attrHelper.attributeListToString(entry.getValue(), ", "));
}
else if (entry.getKey().equals("urn:oid:1.3.6.1.4.1.57378.1.1")){
printableAttributesList.add("bwcard_number");
printableAttributesMap.put("bwcard_number", attrHelper.attributeListToString(entry.getValue(), ", "));
}
else if (entry.getKey().equals("urn:oid:1.3.6.1.4.1.57378.1.1")){
printableAttributesList.add("bwcard_chip_id");
printableAttributesMap.put("bwcard_chip_id", attrHelper.attributeListToString(entry.getValue(), ", "));
}
else {
unprintableAttributesMap.put(entry.getKey(), attrHelper.attributeListToString(entry.getValue(), ", "));
}
......
......@@ -167,6 +167,10 @@ business_rule_package = Regelpaket
business_rules = Regeln
bwcard_chip_id = bwCard Chip ID
bwcard_number = bwCard Nummer
bwidm_org_id = Organisationsk\u00FCrzel
bwunicluster-entitlement-missing = bwUniCluster Entitlement wird nicht von der Heimatorganisation geliefert
......@@ -631,6 +635,8 @@ package_name = Paketname
page_template = Seitentemplates
pairwise_id = Pairwise ID
parent = Parent
parent_service = \u00DCbergeordneter Dienst
......
......@@ -167,6 +167,10 @@ business_rule_package = Rule package
business_rules = Rules
bwcard_chip_id = bwCard Chip ID
bwcard_number = bwCard Number
bwidm_org_id = Org short name
bwunicluster-entitlement-missing = bwUniCluster Entitlement is not delivered by your home organization
......@@ -631,6 +635,8 @@ package_name = Package name
page_template = Page templates
pairwise_id = Pairwise ID
parent = Parent
parent_service = Parent service
......
......@@ -167,6 +167,10 @@ business_rule_package = Paquet de r\u00E8gles
business_rules = R\u00E8gles
bwcard_chip_id = bwCard Chip ID
bwcard_number = Num\u00E9ro de bwCard
bwidm_org_id = Nom court de l'organisation
bwunicluster-entitlement-missing = bwUniCluster Entitlement n'est pas livr\u00E9 par votre organisation d'origine
......@@ -631,6 +635,8 @@ package_name = Nom du paquet
page_template = Mod\u00E8les de page
pairwise_id = Pairwise ID
parent = Parent
parent_service = Service parent
......
......@@ -42,7 +42,8 @@
</p:dataTable>
</div>
<div class="panel">
<p:dataList var="key" value="#{registerOidcUserBean.unprintableAttributesMap.keySet().toArray()}">
<p:dataList var="key" value="#{registerOidcUserBean.unprintableAttributesMap.keySet().toArray()}"
rendered="#{not registerOidcUserBean.unprintableAttributesMap.isEmpty()}">
#{key}: #{registerOidcUserBean.unprintableAttributesMap[key]}
</p:dataList>
</div>
......
......@@ -41,7 +41,8 @@
</p:column>
</p:dataTable>
<p:dataList var="key" value="#{registerUserBean.unprintableAttributesMap.keySet().toArray()}">
<p:dataList var="key" value="#{registerUserBean.unprintableAttributesMap.keySet().toArray()}"
rendered="#{not registerUserBean.unprintableAttributesMap.isEmpty()}">
#{key}: #{registerUserBean.unprintableAttributesMap[key]}
</p:dataList>
......
Markdown is supported
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