Azure SSO to Salesforce

## Azureアカウント申請

### https://azure.microsoft.com/ja-jp/pricing/purchase-options/azure-account/  でアカウントを作成、クレジットカードの登録が必須
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/1a85417f-de9f-4eb0-9375-7984fb8bb5fb.png)

クレジットカードの登録していなしで申請できる場合もあるが、Azureでアプリ作成で以下のエラーが発生します。
"errorMessage": "interaction_required: AADSTS16000: User account &#39;{EUII Hidden}&#39; from identity provider &#39;live.com&#39; does not exist in tenant &#39;Microsoft Services&#39; and cannot access the application &#39;74658136-14ec-4630-ad9b-26e160ff0fc6&#39;(ADIbizaUX) in that tenant. The account needs to be added as an external user in the tenant first. Sign out and sign in again with a different Azure Active Directory user account. Trace ID: 625b3a88-0e04-40cc-847d-0da8bc391100 Correlation ID: 97cc15c4-b5ac-41c1-9f0b-44b9aab7ae26 Timestamp: 2025-04-22 00:45:55Z",

## Azure側の設定
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/e71fd47c-5be6-457d-b8e2-be861b606203.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/ce43c422-7e74-41d2-804b-678c609f4989.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/38c80234-58c4-470f-84da-e6dfdb50bbce.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/341a3b07-9745-4fb7-9564-55f90b300a63.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/23a34b2a-8fb3-4fbd-ac8f-2a3dad7969e5.png)

識別子
応答URL
サインオンURL
みっつともSalesforceのMy Domain名
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/b4ac61c5-d8df-4f24-8bf9-48975d3ef579.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/0db632fb-c7e7-4073-8632-6eaf0ea58bf7.png)

### フェデレーション メタデータ XMLをダウンロードし、Salesforce側のシングルサインオン画面でアップロード
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/cde00a9b-bf26-426f-84a8-3266b6044c26.png)

## Salesforce側の設定

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/04ffc9f0-c9dd-4f5b-abc0-213c3ecb7b0a.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/28d50dcf-c5a8-468a-b64e-526ed9a3b356.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/263ad638-4fde-4dcf-937c-39eae835b31e.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/af4b28a6-e351-41b6-9f8d-30d9f3e60af2.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/7495c990-57f8-4bbf-8d80-b0f94442dda2.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/6ce0cdf4-1de9-41c9-b0bc-26f587439ec0.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/06604bf7-5d5c-4bdb-a9f8-9d3d5868cc02.png)

## ユーザーの紐付け
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/9ef6ae0c-8962-43ec-a014-81f5a9ca488a.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/d3c47c87-d3fd-46b8-9a1e-f5ea173ae37c.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/08130c5e-2bb2-45d9-8800-6cd030bffdb7.png)

### シークレット トークンは↑↑↑のセキュリティトークン
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/d4719e9a-df4b-4483-894c-ddf5b8169fdc.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/91d2d32b-e321-4ac3-8f1c-a85e4b004ce3.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/916e74af-ab5c-4528-bc78-db3b195194ab.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/6bc15d8d-9fe4-4db9-bddc-1e4c56faad09.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/72f22e75-42ac-4e49-b130-eb829a0ca245.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/364504b7-6c83-4e92-aae9-9b0e7fbc1d87.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/b6e8ecc2-6a70-43db-a060-9da3e26f0db8.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/138abd79-bdf2-45c8-930c-240c7be2e493.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/67af0b11-6700-4d3d-b41b-7a64916ae245.png)

### ↑↑↑の名前をClick
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/a7d08d77-5cd6-4436-9014-52ce1165b66e.png)

#### ↑↑↑ユーザー プリンシパル名xxx#EXT#@をCopyして、Salesforce側の統合 IDに設定
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3894299/4926eee3-0861-499e-8333-70b7663c368d.png)