4. 各バックエンドを利用するための準備¶
ここでは Unicorn ID Manager で各バックエンドを利用する前に 実施する必要のある作業について説明します。
ここでは、以下のバックエンドの事前準備の作業について記載しています。
- Windows Server の Active Directory
- Google Apps
- Azure Active Directory (Office365)
4.1. Windows Server の Active Directory¶
Windows Server の Active Directory をバックエンドにするためには、 Windows Server に 証明書サービス をインストールし、 インストール後に Windows Server の再起動が必要となります。
証明書サービス は PowerShell から以下のコマンドを 実行することでインストールできます。 証明書の有効期限等は運用ポリシーに合わせて任意の値を指定してください。
PS > Add-WindowsFeature ADCS-Cert-Authority -IncludeManagementTools
PS > Install-AdcsCertificationAuthority -CAType EnterpriseRootCA `
-ValidityPeriod Years -ValidityPeriodUnits 10 `
-HashAlgorithmName SHA256 `
-KeyLength 2048
4.2. Google Apps¶
Google Apps をバックエンドにするためには、 以下に示す手順をすべて実施してください。
なお、ここではすでに Google Apps の 管理者アカウントが設定済みで、 かつ Google Apps の言語設定が英語であることを前提とします。
4.2.1. API プロジェクトの作成¶
- https://console.developers.google.com/permissions/serviceaccounts にアクセス
- Project Name に任意のプロジェクト名を入力し Create をクリック
- すでにプロジェクトがある場合は、 Create a project をクリックして プロジェクトを作成
- Create service account をクリック
- Service account name に任意の名前を入力し、
Furnish a new private key と
Enable Google Apps Domain-wide Delegation をクリック。
Key type に JSON が選択されていることを確認して、
Product name for the consent screen に任意の名前を入力して、
Create をクリック
- Service account name と Product name for the consent screen は同一で構いません。
- Close をクリック。JSON 形式のファイルがダウンロードされるので、このファイルを
Unicorn ID Manager がインストールされたサーバーの任意のディレクトリに配置
- このファイルには Google Apps の API を利用するための秘密鍵が 格納されているため、 Unicorn ID Manager を実行するプロセス以外 から参照できないようにしてください。
- 具体的には、パーミッションを 0400 にし、所有者を Unicorn ID Manager 実行ユーザーにしてください。
- 作成したサービスアカウントの View Client ID をクリックし、 Client ID の内容を控える
4.2.2. API の有効化¶
- https://code.google.com/apis/console にアクセス
- API プロジェクトの作成 で設定したプロジェクトを選択
- Admin SDK をクリックし、 Enable をクリック
- Admin SDK が見つからない場合は、検索ボックスから検索
4.2.3. Google Apps ドメインの権限を API に委譲¶
http://admin.google.com/ にアクセス
トップ画面から Security -> API Reference をクリックし、 Enable API access のチェックボックス有効化して Save をクリック
- トップ画面に Security がない場合、 More controls をクリック
トップ画面から Security -> Show more -> Advanced settings -> Manage API client access をクリック
Client Name に API プロジェクトの作成 で控えた Client ID を入力し、 One or More API Scopes に以下を入力
https://www.googleapis.com/auth/admin.directory.user,https://www.googleapis.com/auth/admin.directory.group,https://www.googleapis.com/auth/admin.directory.orgunit
Authorize を入力
4.3. Azure Active Directory (Office365)¶
Azure Active Directory (Azure AD) をバックエンドにするためには、 以下に示す手順を SKU の名前を取得 以外をすべて実施してください。
SKU の名前を取得 はユーザーにライセンスを付与する際に必要な情報を取得する ために必要です。
なお、ここではすでに Azure AD の 管理者アカウントが設定済みで、 かつ Azure AD の言語設定が日本語であることを前提とします。
4.3.1. アプリケーション ID の作成¶
- https://manage.windowsazure.com/ にアクセス
- Active Directory -> <自組織> -> アプリケーション をクリックして、 追加 をクリック
- 組織で開発中のアプリケーションを追加 をクリックし、 名前 に任意の名前を入力。 WEB アプリケーションや WEB API がチェックされていることを確認し、 次へ (右矢印 をクリック)
- Unicorn ID Manager はシングルサインオンを利用しないため、 サインオン URL と
アプリケーション ID/URI は URL 形式の任意の一意な文字列を入力して終了 (チェックマークをクリック)
- 例えば、 https://uidm.example.com/ を入力
- 構成 をクリックし、 キー -> 時間の選択 から 1 年 か 2 年 を選択し、 保存 をクリック
- 表示されたキー値を控える
- 以降、この値は表示されなくなります
- キー値は流出しないように厳重に保管してください
- クライアント ID の値を控える
4.3.2. アプリケーション ID にロールを割り当て¶
Windows 端末にて PowerShell 用の Azure AD モジュールをインストール (http://msdn.microsoft.com/library/azure/jj151815.aspx からダウンロード)
PowerShell を開き、以下のコマンドを実行 (<APPNAME> は アプリケーション ID の作成 の 3. で作成した名前)
$APPNAME = "<APPNAME>" Import-Module MSOnline Connect-MsolService Add-MsolRoleMember -RoleName "User Account Administrator" -RoleMemberType ServicePrincipal -RoleMemberObjectId (Get-MsolServicePrincipal -SearchString $APPNAME).ObjectId
4.3.3. SKU の名前を取得¶
Windows 端末にて PowerShell 用の Azure AD モジュールをインストール (http://msdn.microsoft.com/library/azure/jj151815.aspx からダウンロード)
PowerShell を開きサブスクリプションごとに割り当てられている SKU の名前 を取得
Import-Module MSOnline Connect-MsolService Get-MsolAccountSku | Select-Object -Property SkuPartNumber
出力された情報のうち SkuPartNumber の列以下の情報を控える (たとえば、以下のような出力が得られます)
SkuPartNumber ------------- STANDARDPACK