6 .NETを使用したアイデンティティ・コネクタの開発
この章は、Identity Connector Framework(ICF)とOracle Identity Managerメタデータを使用して.NETでアイデンティティ・コネクタを開発するのに必要な手順全体を確認するチュートリアルとなります。ここには、重要なICFクラスとインタフェース、コネクタ・バンドルおよびコネクタ・サーバーについての情報と、フラット・ファイル.NETアイデンティティ・コネクタの実装のコード例や、ユーザー・プロビジョニングとリコンシリエーションのプロセス用にOracle Identity Managerメタデータを作成するコード例が含まれています。
この章の構成は、次のとおりです。
6.1 フラット・ファイル.NETコネクタの開発
フラット・ファイル.NETコネクタを開発するには、Microsoft Visual Studioにプロジェクトを設定し、AbstractConfiguration、PoolableConnector、AbstractFilterTranslatorの各クラスを実装し、プロジェクトをビルドします。
この項では、フラット・ファイル.NETコネクタを開発する手順の概要をコード・サンプルとともに示します。
次の項目が含まれます。
6.1.1 フラット・ファイル.NETコネクタの開発の概要
フラット・ファイル・コネクタは、構成インタフェースの実装を開発し、その後、コネクタ・クラスを実装するという手順で開発します。
このドキュメントでは、作成、削除、更新および検索操作のフラット・ファイル・コネクタのサンプル実装について説明します。実装およびドキュメントを単純化するために、コネクタによってサポートされる構成プロパティおよびスキーマは最小限に維持されています。このコネクタの実装は、実際のコネクタの作成に役立つサンプルとしてのみ使用してください。
コネクタの実装を単純にするために、フラット・ファイルには名前、性別、資格、年齢属性のみが含まれていると仮定します。2つの構成ファイルの場所およびデリミタがあります。残りの構成は、サンプルにハードコードされています。
6.1.2 フラット・ファイル.NETコネクタの開発
フラット・ファイル.NETコネクタを開発するには、Microsoft Visual Studioにプロジェクトを設定し、AbstractConfiguration、PoolableConnector、AbstractFilterTranslatorの各クラスを実装し、プロジェクトをビルドします。
フラット・ファイル.NETコネクタを開発するには:
-
Microsoft Visual Studioでコネクタを使用して、プロジェクトを設定します。
-
タイプ・ライブラリの新しいVisual Studioプロジェクトを作成します。
-
参照として次のdllが追加されていることを確認します。
- Common.dll
- Framework.dll
- FrameworkInternal.dll
- System.dll
- System.Core.dll
これらのdllは、.NETコネクタ・サーバーで使用可能である必要があります。
-
-
Org.IdentityConnectors.Framework.Spi.AbstractConfigurationベース・クラスを拡張して、フラット・ファイル・コネクタ用の構成クラスを実装します。AbstractConfigurationの実装については、AbstractConfigurationの実装を参照してください。
-
異なるSPIインタフェース
Org.IdentityConnectors.Framework.Spiを実装することで、フラット・ファイル・コネクタにコネクタ・クラスを作成します。PoolableConnectorの実装については、PoolableConnectorの実装を参照してください。 -
このコネクタは、CreateEqualsExpression操作のみをサポートします。CreateEqualsExpressionを実装します。Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator<T>の実装については、AbstractFilterTranslatorの実装を参照してください。
-
異なるクラスを実装します(ステップ2、3および4を参照)。
-
プロジェクトのAssemblyInfo.csに存在するAssemblyVersionをノートにとります。サンプルAssemblyInfo.csファイルについては、サンプルAssemblyInfo.csファイルを参照してください。
-
プロジェクトをビルドします。プロジェクトは、コネクタDLLを作成する必要があります。
6.1.3 AbstractConfigurationの実装
Org.IdentityConnectors.Framework.Spi.AbstractConfigurationベース・クラスは、フラット・ファイル・コネクタ用の構成クラスを実装するように拡張できます。
次のコード・サンプルは、AbstractConfigurationの実装を示しています。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Org.IdentityConnectors.Framework.Spi;?
using Org.IdentityConnectors.Framework.Common.Exceptions;?
using System.IO;
namespace Org.IdentityConnector.FlatFileConnector?
{
/// <summary>
/// Configuration class for flat file connector representing target system information?
/// </summary>
public class FlatFileConfiguration : AbstractConfiguration?
{
#region FileName
/// <summary>
/// Target file name
/// </summary>
/// <value>
/// File name with complete path. As for executing the .NET Connector bundle we need .NET Connector Server, hence the file should reside
/// on the machine where the connector server is present.
/// </value>
[ConfigurationProperty(Required = true, Order = 1)]
public String FileName { get; set; }
#endregion
#region Delimiter
/// <summary>
/// Delimiter used within the target flat file
/// </summary>
/// <value>
/// Delimter
/// </value>
[ConfigurationProperty(Required = true, Order = 2)]
public String Delimiter { get; set; }
#endregion
#region
/// <summary>
/// Validates if the configuration properties provided are as requiered, if not throw ConfigurationException
/// </summary>
public override void Validate()
{
if (this.FileName == null || this.FileName.Length == 0)
{
throw new ConfigurationException("Configuration property FileName cannot be null or empty");
}
if (!File.Exists(this.FileName))
{
throw new ConfigurationException("Target file " + this.FileName + " does not exist");
}
if (this.Delimiter == null || this.Delimiter.Length == 0)
{
throw new ConfigurationException("Configuration property Delimiter cannot be null or empty");
}
}
#endregion
}
}
6.1.4 PoolableConnectorの実装
Org.IdentityConnectors.Framework.Spiインタフェースは、フラット・ファイル・コネクタのコネクタ・クラスを作成するように実装できます。
次のコード・サンプルでは、PoolableConnector,CreateOp,SchemaOp,TestOp,DeleteOp,UpdateOp,SearchOp<String>インタフェースを実装するため、すべてのCRUD操作をサポートします。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Org.IdentityConnectors.Framework.Spi;
using System.IO;
using Org.IdentityConnectors.Framework.Common.Exceptions;
using System.Security.AccessControl;
using Org.IdentityConnectors.Framework.Spi.Operations;
using Org.IdentityConnectors.Framework.Common.Objects;
using Org.IdentityConnectors.Common;
namespace Org.IdentityConnector.FlatFileConnector
{
/// <summary>
/// FlatFileConnector showing implementation of SchemaOp, test, create, delete, update and search operations.
/// </summary>
[ConnectorClass("FlatFileConnector_DisplayNameKey",typeof(FlatFileConfiguration))]
public class FlatFileConnector : PoolableConnector,CreateOp,SchemaOp,TestOp,DeleteOp,UpdateOp,SearchOp<String>
{
/// <summary>
/// Flat file configuration instance. This instance has the target system information.
/// </summary>
private FlatFileConfiguration config;
#region Init
/// <summary>
/// Create a connection to target and store it for later use. But here we just set attributes of target file
/// name to Normal
/// </summary>
/// <param name="config">Configuration Object</param>
public void Init(Configuration config)
{
this.config = (FlatFileConfiguration)config;
File.SetAttributes(this.config.FileName, FileAttributes.Normal);
}
#endregion
#region CreateOp Members
/// <summary>
/// This creates a new row in the target file with the data as sent in the 'attrs'
/// </summary>
/// <param name="objClass">The ObjectClass. Here we support only Account</param>
/// <param name="attrs">Attributes of this Account that need to be created on target</param>
/// <param name="options">Will always be empty</param>
/// <returns>Unique id Uid, representing the Account which was just created</returns>
public Uid Create(ObjectClass objClass, ICollection<ConnectorAttribute> attrs, OperationOptions options)
{
ConnectorAttribute NameAttribute = ConnectorAttributeUtil.Find(Name.NAME, attrs);
ConnectorAttribute AgeAttribute = ConnectorAttributeUtil.Find("Age", attrs);
ConnectorAttribute QualificationAttribute = ConnectorAttributeUtil.Find("Qualification", attrs);
ConnectorAttribute GenderAttributute = ConnectorAttributeUtil.Find("Gender", attrs);
StreamWriter writer = File.AppendText(this.config.FileName);
writer.WriteLine("\nName:" + ConnectorAttributeUtil.GetAsStringValue(NameAttribute) + this.config.Delimiter + "Age:" + ConnectorAttributeUtil.GetAsStringValue(AgeAttribute) + this.config.Delimiter + "Qualification:" + ConnectorAttributeUtil.GetAsStringValue(QualificationAttribute) + this.config.Delimiter + "Gender:" + ConnectorAttributeUtil.GetAsStringValue(GenderAttributute));
writer.Flush();
writer.Dispose();
writer.Close();
return new Uid(ConnectorAttributeUtil.GetAsStringValue(NameAttribute));
}
#endregion
#region DeleteOp Members
/// <summary>
/// Deletes an entity from target flat file. We support only ACCOUNT object class.
/// If the Uid (user name) is not found then UnknownUidException is thrown
/// </summary>
/// <param name="objClass"></param>
/// <param name="uid"></param>
/// <param name="options"></param>
public void Delete(ObjectClass objClass, Uid uid, OperationOptions options)
{
String[] allLines = File.ReadAllLines(this.config.FileName);
String[] newLines = new String[allLines.Length];
Boolean userExisted = false;
for (int i = 0; i < allLines.Length; i++)
{
char[] separator = new char[] { '$' };
String[] thisLineSplit = allLines[i].Split(separator);
String name = "";
foreach (String str in thisLineSplit)
{
if (str.StartsWith("Name"))
{
name = str;
break;
}
}
if (!name.Equals("Name" + ":" + uid.GetUidValue()))
{
newLines[i] = allLines[i];
}
else
{
userExisted = true;
}
}
if (userExisted)
{
File.WriteAllText(this.config.FileName, String.Empty);
File.WriteAllLines(this.config.FileName, newLines);
}
else
{
throw new UnknownUidException("Uid "+uid.GetUidValue()+" not found");
}
}
#endregion
#region UpdateOp Members
/// <summary>
/// Updates information of an existing user on the target flat file
/// </summary>
/// <param name="objclass">The ObjectClass. Here we support only user</param>
/// <param name="uid">Unique id of the user using which we can find out the user on target. This is the returned vaue by CreateOp implementation</param>
/// <param name="replaceAttributes">Updated attributes of user which should replace all existing user information on target</param>
/// <param name="options">This will always be empty</param>
/// <returns>Updated uid. It can be the same value which was provided to this method.</returns>
public Uid Update(ObjectClass objclass, Uid uid, ICollection<ConnectorAttribute> replaceAttributes, OperationOptions options)
{
String uidValue = uid.GetUidValue();
String[] allLines = File.ReadAllLines(this.config.FileName);
String[] updatedLines = new String[allLines.Length];
Boolean userExists = false;
Uid updatedUid = uid;
for(int i = 0; i < allLines.Length; i++)
{
String[] thisLineSplit = allLines[i].Split(new char[] { '$' });
String name = "";
foreach (String str in thisLineSplit)
{
if (str.StartsWith("Name"))
{
name = str;
break;
}
}
String nameToBeUpdated = "Name:" + uidValue;
if (!name.Equals(nameToBeUpdated))
{
updatedLines[i] = allLines[i];
}
else
{
ConnectorAttribute NameAttribute = ConnectorAttributeUtil.Find(Name.NAME, replaceAttributes);
ConnectorAttribute AgeAttribute = ConnectorAttributeUtil.Find("Age", replaceAttributes);
ConnectorAttribute QualificationAttribute = ConnectorAttributeUtil.Find("Qualification", replaceAttributes);
ConnectorAttribute GenderAttribute = ConnectorAttributeUtil.Find("Gender", replaceAttributes);
updatedLines[i] = "Name:"+NameAttribute.Value.First().ToString()+this.config.Delimiter+
AgeAttribute.Name+":"+AgeAttribute.Value.First().ToString()+this.config.Delimiter+
QualificationAttribute.Name+":"+QualificationAttribute.Value.First().ToString()+this.config.Delimiter+
GenderAttribute.Name+":"+GenderAttribute.Value.First().ToString();
userExists = true;
updatedUid = new Uid(NameAttribute.Value.First().ToString());
}
}
File.WriteAllText(this.config.FileName, String.Empty);
File.WriteAllLines(this.config.FileName, updatedLines);
if (!userExists)
{
throw new UnknownUidException("User "+uid.GetUidValue()+" not found");
}
return updatedUid;
}
#endregion
#region SearchOp<string> Members
/// <summary>
/// Returns a filter translator used by ExecuteQuery. The functionality of filter translator is to translate any filters provided by calling application (OIM/OW/OPAM) to native queries.
/// </summary>
/// <param name="oclass">The ObjectClass. We support only ACCOUNT</param>
/// <param name="options">Options</param>
/// <returns>FilterTranslator instance</returns>
public Org.IdentityConnectors.Framework.Common.Objects.Filters.FilterTranslator<string> CreateFilterTranslator(ObjectClass oclass, OperationOptions options)
{
return new FlatFileFilterTranslator();
}
/// <summary>
/// Performs search on target based on query. Uses the handler instance to return back the searched result.
/// </summary>
/// <param name="oclass">The ObjectClass. This tells if we have to search for user (ACCOUNT) or group (GROUP). We support only user</param>
/// <param name="query">Query as returned by FilterTranslator</param>
/// <param name="handler">handler to return back result to caller</param>
/// <param name="options">Options containing what attributes of entity to return back</param>
public void ExecuteQuery(ObjectClass oclass, string query, ResultsHandler handler, OperationOptions options)
{
String[] results = GetResults(query);
foreach (String result in results)
{
Console.WriteLine("Result = "+result);
String result1 = result.Trim();
if (result1.Length > 0)
{
Console.WriteLine("Submitting result = " + result1);
SubmitConnectorObject(result1, handler);
}
}
}
#region SchemaOp Members
/// <summary>
/// Defines the schema supported by this connector
/// </summary>
/// <returns>Schema</returns>
public Schema Schema()
{
SchemaBuilder schemaBuilder = new SchemaBuilder(SafeType<Connector>.Get(this));
ICollection<ConnectorAttributeInfo> connectorAttributeInfos = new List<ConnectorAttributeInfo>();
connectorAttributeInfos.Add(ConnectorAttributeInfoBuilder.Build("Name"));
connectorAttributeInfos.Add(ConnectorAttributeInfoBuilder.Build("Age"));
connectorAttributeInfos.Add(ConnectorAttributeInfoBuilder.Build("Qualification"));
connectorAttributeInfos.Add(ConnectorAttributeInfoBuilder.Build("Gender"));
schemaBuilder.DefineObjectClass(ObjectClass.ACCOUNT_NAME, connectorAttributeInfos);
return schemaBuilder.Build();
}
#endregion
#region TestOp Members
/// <summary>
/// Should ideally test the connecttion with target. But here we just print something as we have assumed that target file is on same machine
/// </summary>
public void Test()
{
Console.Write("Tested connection!");
}
#endregion
#region CheckAlive
/// <summary>
/// Check connection to target system is alive or not. But here we just check if target file name
/// provided in the FlatFileConfiguration is available or not.
/// </summary>
public void CheckAlive()
{
if (!File.Exists(this.config.FileName))
{
throw new ConnectorException("Target file " + this.config.FileName + " does not exist");
}
}
#endregion
#region Dispose
/// <summary>
/// Remove connection from target, dispose any of the resources used. But here we just chill.
/// </summary>
public void Dispose()
{
//chill :)
}
#endregion
private void SubmitConnectorObject(String result, ResultsHandler handler)
{
ConnectorObjectBuilder cob = new ConnectorObjectBuilder();
String[] resultSplit = result.Split(new char[]{'$'});
ICollection<ConnectorAttribute> attrs = new List<ConnectorAttribute>();
foreach (String str in resultSplit)
{
ConnectorAttributeBuilder cab = new ConnectorAttributeBuilder();
cab.AddValue(str.Split(new char[] { ':' })[1]);
if (str.StartsWith("Name"))
{
cob.SetName(Name.NAME);
cob.SetUid(str.Split(new char[] { ':' })[1]);
cab.Name = Name.NAME;
}
else
{
cab.Name = str.Split(new char[] { ':' })[0];
}
attrs.Add(cab.Build());
}
cob.AddAttributes(attrs);
handler(cob.Build());
}
private String[] GetResults(String query)
{
String[] allLines = File.ReadAllLines(this.config.FileName);
String[] results = allLines;
if (query != null)
{
for (int i = 0; i < allLines.Length; i++)
{
String[] thisLineSplit = allLines[i].Split(new char[]{'$'});
Boolean foundResult = false;
foreach (String str in thisLineSplit)
{
if (str.StartsWith("Name") && str.Equals(query))
{
foundResult = true;
break;
}
}
if (foundResult)
{
return new String[] {allLines[i]};
}
}
}
return results;
}
#endregion
}
}
6.1.5 AbstractFilterTranslatorの実装
Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator<T>インタフェースは、CreateEqualsExpression操作用に実装できます。
次のコード・サンプルに、フィルタ操作を定義するOrg.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator<T>のサンプル実装を示します。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Org.IdentityConnectors.Framework.Common.Objects.Filters;
using Org.IdentityConnectors.Framework.Common.Objects;
namespace Org.IdentityConnector.FlatFileConnector
{
/// <summary>
/// FlatFileFilterTranslator. This translator converts the equalsFilter provided by the calling application to native query which can be used by the connector while searching.
/// The implementation shown supports only equals filter. i.e it has provided implementation for only CreateEqualsExpression, this means that if any other filter is provided
/// by the calling application, it would not be translated as a native query and search implementation gets all users and filtering will be done by ICF with all results.
///
/// </summary>
public class FlatFileFilterTranslator : AbstractFilterTranslator<String>
{
/// <summary>
/// Creates a native query for equals filter and returns it only if equals filter is constructed for Name attribute and not for any other attributes.
/// </summary>
/// <param name="filter">Filter provided by calling application</param>
/// <param name="not"></param>
/// <returns></returns>
protected override string CreateEqualsExpression(EqualsFilter filter, bool not)
{
ConnectorAttribute attr = filter.GetAttribute();
if (attr.Name.Equals(Name.NAME))
{
return "Name:" + attr.Value.First().ToString();
}
return null;
}
}
}
6.1.6 サンプルAssemblyInfo.csファイル
AssemblyInfo.csプロジェクト・ファイルには、AssemblyVersionが含まれています。
サンプルAssemblyInfo.csファイルの内容は、次のとおりです。
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("FlatFileConnector")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Oracle Corporation")]
[assembly: AssemblyProduct("FlatFileConnector")]
[assembly: AssemblyCopyright("Copyright © Oracle Corporation 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(true)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("79eec317-62bd-49a5-9512-88d61135684c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
6.2 .NETコネクタ・サーバーでのアイデンティティ・コネクタ・バンドルのデプロイ
.NETに実装されているすべてのコネクタで、コネクタを実行する.NETコネクタ・サーバーを持つ必要があります。
コネクタ・バンドルはOracle Identity Manager内にデプロイすることはできません。したがって、ICF .NETアイデンティティ・コネクタとOracle Identity Managerを統合するために次の手順を実行する必要があります。
6.2.1 .NETコネクタ・サーバーへのコネクタ・バンドルの登録
コネクタ・バンドルを.NETコネクタ・サーバーに登録するには、CONNECTOR_SERVER_HOMEの場所でコネクタDLLをコピーします。
.NETコネクタ・サーバーでコネクタ・バンドルを登録またはデプロイするには、次のステップを実行します。
- .NETコネクタ・サーバーをインストールします。.NETコネクタ・サーバーのインストールの詳細は、.NETコネクタ・サーバーのインストールを参照してください。
- コネクタ・サーバーを停止します。コネクタ・サーバー・サービスが実行していないことを確認してください。
- CONNECTOR_SERVER_HOMEの場所でコネクタDLLをコピーします。CONNECTOR_SERVER_HOMEは、.NETコネクタ・サーバーのインストール後に、ConnectorServer.exeおよびファイルに関連するその他のコネクタ・サーバーが存在する場所です。
- .NETコネクタ・サーバーを起動します。
6.2.2 基本的なアイデンティティ・コネクタ・メタデータの作成
基本的なアイデンティティ・コネクタ・メタデータ構成は、プロビジョニングとリコンシリエーションの両方で必要となります。構成には、ITリソース・タイプ定義、リソース・オブジェクトおよび参照の作成が含まれます。
この項では、Design Consoleを使用して基本的なアイデンティティ・コネクタ・メタデータ構成を実行する方法について説明します。次の項目が含まれます。
6.2.2.1 ITリソース・タイプ定義の作成
ITリソース・タイプ定義は、リソースの接続情報の表現です。ITリソース・タイプ定義内の構成パラメータは、コネクタ・バンドルの構成パラメータと一致する必要があります。ITリソース内のパラメータの値は、バンドル構成で設定されます。
ノート:
バンドル構成によって使用されないパラメータを含めることができます。これらは、バンドル操作に悪影響は与えません。
ITリソース・タイプ定義を作成するには:
6.2.2.2 リソース・オブジェクトの作成
リソース・オブジェクトは、Oracle Identity Managerでのリソースの表現です。コネクタ・バンドルは、リソース・オブジェクトに関連付けられています。
リソース・オブジェクトを作成するには:
6.2.2.3 参照の作成
コネクタ・バンドルでサポートされている様々なオブジェクトに対して個別の参照を定義する必要があります。この参照には、これらのオブジェクトのプロビジョニングおよびリコンシリエーションに関連する情報を含めることができます。メインの構成参照は、これらの参照へのポインタが含まれているため、オブジェクト固有の参照のルートになります。次の項では、参照の作成方法について説明します。
6.2.2.3.1 メインの構成参照の作成
(ITリソース・タイプ定義の作成で定義した)構成参照には、接続情報とはみなされないコネクタ・バンドル構成が保持されます。ITリソース・タイプ定義で構成パラメータが見つからない場合、Oracle Identity Managerは構成参照を検索します。メインの構成参照には、バンドル・プロパティおよびバンドル構成が含まれています。バンドル・プロパティ・パラメータは、正しいバンドルの識別に必要であるため、必須です。ITリソース・タイプ定義の一部として定義されていないバンドル構成(ITリソース・タイプの定義の作成を参照)は、ここで宣言できます。
ノート:
コード・キーの値は、図と完全に一致する必要があります。デコードの値は、コネクタ・バンドルに固有です。
メインの構成参照を作成するには:
6.2.2.3.2 オブジェクト・タイプの構成参照の作成
オブジェクト・タイプの構成参照には、特定のオブジェクト・タイプに固有のパラメータが含まれています。オブジェクト・タイプは、アイデンティティ・コネクタが動作するエンティティです。ICF ObjectClassにマップされます。メインの構成参照の作成でUser Configuration Lookupが参照されているため、Userがオブジェクト・タイプとなり、この場合はObjectClass.ACCOUNTにマップされています。(RolesとUserJobDataが、その他の2つのオブジェクト・タイプです。)オブジェクト・タイプ名は、アイデンティティ・コネクタ・バンドルでサポートされているオブジェクト・クラス名と一致する必要があります。Userオブジェクト・タイプは事前定義済のObjectClass.ACCOUNTにマップされ、Groupオブジェクト・タイプは事前定義済ObjectClass.GROUPにマップされます。アイデンティティ・コネクタが複数のオブジェクトをサポートしている場合、このステップをそれぞれに対して繰り返す必要があります。
ノート:
これらのユースケースは基本機能のみを対象としているため、この構成は必須属性として保持されます。
オブジェクト・タイプの構成参照を作成するには:
6.2.3 プロビジョニング・メタデータの作成
フラット・ファイル・プロビジョニング用にOracle Identity Managerを構成するには、プロビジョニング・メタデータを作成します。そのためには、プロセス・フォーム、アダプタ、プロセス定義およびプロビジョニング属性マッピング参照を作成します。
次の項は、フラット・ファイル・プロビジョニング用にOracle Identity Managerを構成するために実行する必要があります。
6.2.3.1 プロセス・フォームの作成
プロセス・フォームは、Oracle Identity Managerでのオブジェクト属性の表現として使用されます。
この項では、プロセス・フォームとプロセス・フォームを作成する方法について説明します。次の項目が含まれます。
6.2.3.1.1 プロセス・フォームについて
プロセス・フォームは、Oracle Identity Managerでのオブジェクト属性の表現として使用されます。これにより、操作のためにオブジェクト属性がコネクタ・バンドルに渡される前に、ユーザーが設定を容易に入力できます。
プロセス・フォームで定義された属性は、規則ではありません。このフォームは、アイデンティティ・コネクタに渡される必要がある属性に対するチャレンジの方法です。一般的に、アイデンティティ・コネクタのサポートされている各属性に対して属性を定義します。
ノート:
アイデンティティ・コネクタ属性で1対1のマッピングを設定することをお薦めします。
対応するITリソース・タイプ定義に関連付ける必要があるITリソースを問い合せるためのフィールドが存在する必要があります。各フィールドの変数タイプは、オブジェクト属性のタイプにマップする必要があります。
6.2.3.1.3 コネクタ・スキーマの属性
表6-1に、コネクタ・スキーマに定義されている属性をリストします。
表6-1 「フォーム・デザイナ」のフィールド
| 名前 | バリアント | フィールド・ラベル | フィールド・タイプ |
|---|---|---|---|
|
UD_FLATFILE_NAME |
文字列 |
名前 |
TextField |
|
UD_FLATFILE_AGE |
文字列 |
年齢 |
TextField |
|
UD_FLATFILE_QUALIFICATION |
文字列 |
資格情報 |
TextField |
|
UD_FLATFILE_GENDER |
文字列 |
性別 |
LookupField |
|
UD_FLATFILE_RETURNIDQ |
文字列 |
Return Id |
DOField |
|
UD_FLATFILE_ITRESOURCE |
Long |
ITリソース |
ITResourceLookup |
ノート:
フラット・ファイルの列名は、FirstName、ChangeNo、EmailID、Server、LastNameおよびAccountIDです。
6.2.3.2 アダプタの作成
コネクタ・バンドルでサポートされているすべての操作(作成、更新、削除など)に対してアダプタを作成する必要があります。
アダプタを作成するには:
-
Oracle Identity Manager Design Consoleにログインします。
-
「開発ツール」の下の「アダプタ・ファクトリ」をクリックします。
-
新しいアダプタを作成して、アダプタ名として、フラット・ファイルの作成ユーザーを追加します。
-
「アダプタ・タイプ」として「プロセス・タスク」を追加します。
-
アダプタを保存します。
-
図6-7に示すように、「変数リスト」タブをクリックして、次の変数を追加します。
-
「タイプ」が「文字列」で、マップが実行時に解決であるobjectType。
-
「タイプ」が「ロング」で、マップが実行時に解決であるprocessInstanceKey。
-
「タイプ」が「文字列」で、マップが実行時に解決であるitResourceFieldName。
-
-
図6-8に示すように、次のサブ手順を実行して、Java機能タスクをアダプタに追加します。
-
アダプタ・タスク・タブをクリックします。
-
アダプタを選択し、「追加」をクリックします。
-
タスク・オプションからJavaを選択します。
-
APIソースから「icf-oim-intg.jar」を選択します。
-
APIソースとして「oracle.iam.connetors.icfcommon.prov.ICProvisioninManager」を選択します。
-
タスクのメソッドとして「createObject」を選択します。
-
構成を保存します。
-
(すでに変数リストに追加した)変数を、適切なメソッド入力および出力にマップします。
-
構成パラメータを、適切なメソッド入力および出力にマップします。
データベース参照はデータベース参照(アダプタ参照)にマップし、戻り変数は戻り変数(アダプタ変数)にマップします。
-
-
アダプタを保存してビルドします。
6.2.3.3 プロセス定義の作成
プロセス定義では、特定の操作用のコネクタ・バンドルの動作を定義します。すべての操作には、関連付けられている対応タスクがあります。
次の手順では、作成操作のプロセス定義、およびプロセス・タスクの統合を構成します。
6.2.3.4 プロビジョニング属性マッピング参照の作成
プロビジョニング属性マッピング参照には、アイデンティティ・コネクタ・バンドル属性へのOracle Identity Managerフィールドのマッピングが含まれます。
この項では、プロビジョニング属性マッピング参照を作成する方法について説明します。次の項目が含まれます。
6.2.3.4.1 プロビジョニング属性マッピング参照について
プロビジョニング属性マッピング参照には、アイデンティティ・コネクタ・バンドル属性へのOracle Identity Managerフィールドのマッピングが含まれます。プロビジョニング属性マッピング参照の説明を次に示します。
-
コード・キーは、プロセス・フォームのフィールド・ラベルです。
-
デコードは、アイデンティティ・コネクタ・バンドル属性です。
-
子フォーム属性は、入力での埋込みオブジェクトとして構成できます。
-
アイデンティティ・コネクタのプロビジョニング操作は、レスポンスでUIDを返します。これは、アイデンティティ・コネクタ・バンドル属性に対してコーディングして、フォーム・フィールドに設定できます。
6.2.3.4.3 プロビジョニング属性マップで使用されるフィールド・フラグ
ノート:
これらのプロパティは、高度なオプションで、コネクタの現在の実装では省略できます。
プロビジョニング属性マッピングの場合、次のフィールド・フラグをコード・キーに追加できます。
-
LOOKUP: これは、参照リコンシリエーション・ジョブの実行によって値が取得されるすべてのフィールドに指定する必要があります。参照リコンシリエーション・ジョブから取得された値には、ITリソース名/キーが追加されています。このフラグを指定すると、追加された値をバンドルに渡す直前にICF統合で削除するのに役立ちます。たとえば、ラベルがDatabaseで、参照リコンシリエーション・ジョブの実行により値が取得されたフィールドのコード・キーは、Database[LOOKUP]のようになります。
ノート:
LOOKUPフラグは、プロビジョニングとリコンシリエーション両方の属性マップに指定できます。プロビジョニングの場合、ITリソース名/ITリソース・キー接頭辞を削除する必要があります。リコンシリエーションの場合、ITリソース名/ITリソース・キー接頭辞を追加する必要があります。
-
IGNORE: これは、値が無視され、バンドルに送信されないすべてのフィールドに指定する必要があります。たとえば、ラベルがDatabaseで、値をバンドルに送信する必要がないフィールドのコード・キーは、Database[IGNORE]のようになります。
-
WRITEBACK: これは、作成操作または更新操作の直後に値をプロセス・フォームに書き戻す必要があるすべてのフィールドに指定する必要があります。このフラグを追加すると、ICF統合レイヤー・コールICF Get APIが、WRITEBACKフラグのマークがある属性の値を取得するようになります。たとえば、ラベルがDatabaseで、作成/更新の直後に値がプロセス・フォームに書き戻される必要があるフィールドのコード・キーは、Database[WRITEBACK]のようになります。これが機能するには、コネクタはGetApiOpインタフェースを実装し、ConnectorObject getObject(ObjectClass objClass、Uid uid、OperationOptionsオプション)APIに実装を提供する必要があります。このAPIは、Uidが渡されたUidと同じであるアカウントのターゲットを検索し、プロセス・フォームに書き戻されるすべての属性(およびその値)が含まれたコネクタ・オブジェクトをビルドします。
ノート:
コネクタがGetApiOpインタフェースを実装していない場合、WRITEBACKフラグは機能せず、エラーが生成されます。
-
DATE: これは、タイプがDateと見なされる必要があるフィールドに指定する必要があり、これがない場合、値は標準の文字列と見なされます。たとえば、ラベルがTodayで、値が日付形式で表示される必要があるフィールドのコード・キーは、Today[DATE]のようになります。
-
PROVIDEONPSWDCHANGE: これは、パスワード更新が発生した場合に、バンドル(ターゲット)に提供する必要があるすべてのフィールドに指定する必要があります。一部のターゲットは、追加の属性がすべてのパスワード変更で指定されると予測します。PROVIDEONPSWDCHANGEフラグを指定することで、パスワード変更がリクエストされた場合は必ずすべての追加フィールドまたは属性を送信するようICF統合に伝えます。たとえば、ラベルがExtra Attribute Needed for Password Changeで、パスワード更新時に値をバンドル(ターゲット)に提供する必要があるフィールドのコード・キーは、Extra Attribute Needed for Password Change[PROVIDEONPSWDCHANGE]のようになります。
6.2.4 リコンシリエーション・メタデータの作成
フラット・ファイルからレコードのリコンシリエーションを構成できます。
この項では、フラット・ファイルのレコードのリコンシリエーションを構成する手順について説明します。ターゲット・リコンシリエーションを例として使用しますが、信頼できるリコンシリエーションも同様の方法で構成できます。
リストされている順序で手順を実行してください。
6.2.4.1 リコンシリエーション・スケジュール済タスクの作成
デフォルトでは、リコンシリエーションはコネクタ・バンドルで検索操作を使用します。この操作は、Oracle Identity Managerを使用して構成されたスケジュール・タスクで呼び出されます。この手順は、次のサブ手順で構成されています。
6.2.4.2 リコンシリエーション・プロファイルの作成
リコンシリエーション・プロファイルでは、リコンシリエーション時のオブジェクト属性の構造を定義します。リコンシリエーション・プロファイルには、リコンシリエーションをサポートしているすべての属性が含まれている必要があります。
リコンシリエーション・プロファイルを作成するには:
6.2.4.3 リコンシリエーション・アクション・ルールの設定
リコンシリエーション・アクション・ルールでは、リコンシリエーションの動作を定義します。この手順では、一致が見つかった場合に行われるアクションを定義します。この手順では、Oracle Identity Manager Design Consoleにログインしていることを前提にしています。
6.2.4.4 リコンシリエーション・マッピングの作成
リコンシリエーション・マッピングは、プロセス定義で実行する必要があります。これは、サポートされているリコンシリエーション・フィールドを(リソース・オブジェクトから)プロセス・フォーム・フィールドにマッピングすることです。このマッピングは、ターゲット・リコンシリエーションを構成する場合にのみ必要となります。
リコンシリエーション・マッピングを作成するには:
6.2.4.5 リコンシリエーション属性マップで使用されるフィールド・フラグ
リコンシリエーション属性マッピングの場合は、次のフィールド・フラグをコード・キーに追加できます。
-
TRUSTED: これは、アカウントのステータスを表すフィールドのリコンシリエーション属性マップで指定する必要があります。このフラグは、信頼できるリコンシリエーションにのみ指定する必要があります。これが指定されている場合、アカウントのステータスは「アクティブ」または「無効」のいずれかになります。それ以外の場合、ステータスは「有効」または「無効」のいずれかになります。たとえば、ラベルがStatusで、値が「アクティブ」または「無効」のいずれかである必要があるフィールドのコード・キーは、Status[TRUSTED]のようになります。
-
DATE: これは、リコンシリエーション属性マップにおいて、タイプがDateと見なされる必要があるフィールドに指定する必要があります。たとえば、ラベルがTodayで、値が日付形式で表示される必要があるフィールドのコード・キーは、Today[DATE]のようにする必要があります。
6.3 フラット・ファイル・アカウントのプロビジョニング
フラット・ファイル・アカウントをプロビジョニングするには、ITリソース・パラメータおよびLookup.FlatFile.Configurationパラメータを使用して、タイプがFlat FileであるITリソースを作成します。
フラット・ファイル・コネクタの準備は整っています。そのため、ユーザーは、Oracle Identity Managerにログインし、次の手順を使用してITリソース(ターゲット)を作成する必要があります。
-
タイプがFlat FileであるITリソースを作成します。
-
必要に応じて、ITリソース・パラメータを指定します。
-
必要に応じて、Lookup.FlatFile.Configurationに構成パラメータを指定します。


















