ADAM - Y at-il un moyen d'application « magasin » attributs spécifiques?
-
21-08-2019 - |
Question
Je ADAM set-up et j'ai écrit-services Web pour effectuer des tâches comme l'ajout d'administration de nouveaux utilisateurs, etc. (j'ai plusieurs applications utilisant la même instance ADAM)
Ce que je suis en train de réaliser probablement sembler un peu bizarre - mais au fond, je veux un administrateur pour pouvoir sélectionner les attributs du service Web devrait revenir d'Adam. Par exemple. application 1 devrait retourner Sélectionnez et telephoneNumber mais l'application 2 pourrait ne pas avoir besoin des mêmes attributs retournés.
Actuellement, j'ai mis en place une table SQL Server pour stocker les attributs que l'utilisateur a sélectionné pour être retourné et puis dans le service Web en boucle à travers cette option pour charger les attributs requis et ajouter les résultats à un tableau à retourner (Si votre intéressé, je vais ajouter le code en bas).
Je voulais savoir s'il y avait une meilleure façon de le faire? Est-il possible de stocker quelque chose comme cela dans ADAM lui-même?
Merci d'avance pour toute aide!
//using linq to access table
DataClasses1DataContext db = new DataClasses1DataContext();
var queryAttributes = from atr in db.AttributesToReturns
where atr.appNumber == appNumber
select atr;
ArrayList userD = new ArrayList();
foreach (var a in queryAttributes)
{
//the col 'attribute' contains the exact name in active direct e.g. displayName
string att = a.attribute.ToString();
searcher.PropertiesToLoad.Add(att);
}
//--code omitted but here perform search & get req Directory Entry
foreach (var a in queryAttributes)
{
string attributeName = a.attribute.ToString();
try
{
string value = user.Properties[attributeName].Value.ToString();
//do something with value - here i am updating a user object which will be added to the ArrayList the webservice is returning
updateUser(u, attributeName, value);
}
//if an error - just set value to empty
catch (Exception ex)
{
string value = "NULL";
updateUser(u, attributeName, value);
}
}
userD.Add(u);
La solution
Vous pouvez étendre le schéma http: // technet .microsoft.com / fr-fr / bibliothèque / cc759734 (WS.10) .aspx
Ceci est pour OpenLDAP mais les fichiers LDF devrait toujours fonctionner http://www.ibm.com/developerworks/websphere/library/techarticles/0302_singh/singh.html