SPICEy Developments
1 日前
いろんなアイデンティティ管理系製品やサービスの実験の記録をしていきます。 後は、関連するニュースなどを徒然と。
機能 | Office 365 から見た WAAD |
---|---|
シングルサインオン | 信頼するアイデンティティ・プロバイダ ⇒ここで認証されたユーザは信頼できる |
ユーザ/グループ管理 | アイデンティティ・ストア ⇒このデータベースに保持されるユーザ情報(属性など)を利用する |
using System; using Microsoft.WindowsAzure.ActiveDirectory.Authentication; namespace GetAccessToken { class Program { static void Main(string[] args) { string TenantDomainName = "<取得したテナントドメイン名>.onmicrosoft.com"; string TenantId = "<取得したテナントID>"; string AppPrincipalId = "<取得した AppPrincipalId"; string SymmetricKey = "<取得した SymmetricKey>"; AuthenticationContext context = new AuthenticationContext( "https://accounts.accesscontrol.windows.net/" + TenantDomainName); SymmetricKeyCredential credential = new SymmetricKeyCredential( AppPrincipalId + "@" + TenantId, Convert.FromBase64String(SymmetricKey)); AssertionCredential assertion = context.AcquireToken( "00000002-0000-0000-c000-000000000000/directory.windows.net@" + TenantId, credential); System.Console.WriteLine("auth:" + assertion.CreateAuthorizationHeader()); } } }
設定 | 値 | |
---|---|---|
エンドポイント | https://graph.windows.net/advent2012.onmicrosoft.com/Users | |
メソッド | POST | |
ヘッダ | Authorization | 取得したアクセストークン |
x-ms-dirapi-data-contract-version | 0.8 | |
Content-Type | application/atom+xml | |
ボディ | <entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> <content type="application/xml"> <m:properties> <d:ObjectType>User</d:ObjectType> <d:AccountEnabled m:type="Edm.Boolean">true</d:AccountEnabled> <d:DisplayName>織田信長</d:DisplayName> <d:GivenName>信長</d:GivenName> <d:Surname>織田</d:Surname> <d:UserPrincipalName>nobunagao@<テナントドメイン名>.onmicrosoft.com</d:UserPrincipalName> <d:MailNickname>nobunagao</d:MailNickname> <d:Password>P@ssw0rd</d:Password> </m:properties> </content> </entry> |
設定 | 値 | |
---|---|---|
エンドポイント | https://graph.windows.net/advent2012.onmicrosoft.com/Users(‘<対象ユーザ名>@<テナントドメイン>.onmicrosoft.com’) | |
メソッド | PATCH | |
ヘッダ | Authorization | 取得したアクセストークン |
x-ms-dirapi-data-contract-version | 0.8 | |
Content-Type | application/atom+xml | |
ボディ | <entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> <content type="application/xml"> <m:properties> <d:UsageLocation>JP </d:UsageLocation> </m:properties> </content> </entry> |
設定 | 値 | |
---|---|---|
エンドポイント | https://directory.windows.net/<取得したテナントドメイン>.onmicrosoft.com/Users('<割り当てるユーザID>@<取得したテナントドメイン>.onmicrosoft.com')/AssignLicense | |
メソッド | POST | |
ヘッダ | Authorization | 取得したアクセストークン |
x-ms-dirapi-data-contract-version | 0.8 | |
Content-Type | application/json;odata=verbose;charset=utf-8 | |
ボディ | {"AddLicenses": [ { "__metadata": {"type":"Microsoft.WindowsAzure.ActiveDirectory.AssignedLicense"}, "DisabledPlans": {"__metadata": {"type":"Collection(Edm.Guid)"}, "results":[]}, "SkuId":"6fd2c87f-b296-42f0-b197-1e91e994b900" } ], "RemoveLicenses":null } |
設定 | 値 | |
---|---|---|
エンドポイント | https://graph.windows.net/advent2012.onmicrosoft.com/Users(‘<作成したユーザID>@<テナントドメイン>.onmicrosoft.com’) | |
メソッド | DELETE | |
ヘッダ | Authorization | 取得したアクセストークン |
x-ms-dirapi-data-contract-version | 0.8 | |
Content-Type | application/x-www-form-urlencoded? |
we are announcing today that two key features of Windows Azure Active Directory are available at no charge.
- Access control provides centralized authentication and authorization by integrating with consumer identity providers, such as Facebook, or using on-premises Windows Server Active Directory. By having Access Control available you can create a single application that can allow users to login with both their Organizational Credentials stored in Windows Azure AD or Windows Server AD, or to login in using popular consumer service identity services like Microsoft Account, Facebook, Google, or Twitter. Historically, Access Control has been priced based on the number of transactions. We are now making it free.
- Core Directory & Authentication enables capabilities such as single sign-on, user and group management, directory synchronization and directory federation. These features are currently free in the Windows Azure AD Developer Preview and will remain free after it reaches general availability.
GSユアサのID管理・シングルサインオン導入事例 株式会社GSユアサ 情報システム部 活用推進グループ グループマネージャー 小川 敏宏 氏 伊藤忠テクノソリューションズ株式会社 西日本システム技術部 システム技術第2課 課長 富士榮 尚寛 氏 |
講演内容 : 導入の背景やOracle Identity Management 製品を使用した実際のシステム化による効果を様々な視点から紹介し、本システムを利用した今後の展開を紹介します。 また、今回導入したシステムの概要や、ID管理・シングルサインオン プロジェクトを円滑に進めていくためのポイントをご紹介します。 |
Target Endpoint | https://accounts.accesscontrol.windows.net/tokens/OAuth/2 | |
---|---|---|
Method | POST | |
Request Header | Content type | application/x-www-form-urlencoded |
Request Body | grant_type | http://oauth.net/grant_type/jwt/1.0/bearer |
assertion (実際は Symmetric Key でデジタル署名したもの) | { "alg": "HS256", "typ": "JWT" } { "aud": "00000001-0000-0000-c000-000000000000/accounts.accesscontrol.windows.net@[TenantContextId]", "iss": "[AppPrincipalId]@[TenantContextId]", "nbf": "[UNIX 時間で現在の時刻]", "exp": "[UNIX 時間でTokenの有効期限]" } | |
resource | resource : 00000002-0000-0000-c000-000000000000/directory.windows.net@[テナントID] |
import javax.crypto.spec.SecretKeySpec; import javax.crypto.Mac; import org.apache.commons.codec.binary.Base64; public class GenerateSignature { private static byte[] signData(String signingKey, String rawToken) { SecretKeySpec secretKey = null; secretKey = new SecretKeySpec(Base64.decodeBase64(signingKey), "HmacSHA256"); Mac mac; byte[] signedData = null; try { mac = Mac.getInstance("HmacSHA256"); mac.init(secretKey); mac.update(rawToken.getBytes("UTF-8")); signedData = mac.doFinal(); } catch (Exception e) { System.out.println("signData error"); } return signedData; } /** * @param args */ public static void main(String[] args) { String signingkey = "Li7Awy53cq(以下略。SymmetricKey文字列)"; String rawToken = "eyJhbGciOiJ(以下略。ヘッダ部分)).eyJleHAiOiIxMzQ4(以下略。ボディ部分)"; String signature = Base64.encodeBase64String(signData(signingkey,rawToken)); System.out.println(signature); } }
Target Endpoint | https://directory.windows.net/[テナントドメイン名].onmicrosoft.com/Users | |
---|---|---|
Method | GET | |
Request Header | Authorization | 取得した Access Token 文字列(bearer 以降) |
x-ms-dirapi-data-contract-version | 0.8 |
# Active Directory からネーミングコンテキストを取得 $RootDse = [ADSI] "LDAP://RootDSE" $DefaultNamingContext = $RootDse.defaultNamingContext # 対象ユーザの SID を取得 $UserPrincipal = New-Object Security.Principal.NTAccount("<NetBOISドメイン名>", "<利用するユーザ名>") $SID = $UserPrincipal.Translate([System.Security.Principal.SecurityIdentifier]).Value # ディレクトリ・レプリケーション権限を付与 DSACLS "$DefaultNamingContext" /G "$($SID):CA;Replicating Directory Changes"; # 対象 OU および子オブジェクトへのフル・コントロール権限を付与 DSACLS "<対象 OU 名>,$DefaultNamingContext" /G "$($SID):GA" /I:T