You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/[platform]/build-a-backend/auth/examples/microsoft-entra-id-saml/index.mdx
+95-15Lines changed: 95 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,13 +28,13 @@ export function getStaticProps() {
28
28
};
29
29
}
30
30
31
-
Microsoft Entra ID can be configured as a SAML provider for use with Amazon Cognito.
31
+
{/* add important things to know */}
32
+
{/* SAML redirect URIs (including logout and limitation with upstream signout) */}
33
+
{/* how to set attribute mapping with soap namespace */}
32
34
33
-
<Calloutwarning>
34
-
35
-
**Warning:** there is a known limitation where upstream sign-out functionality successfully signs out of Entra ID, but fails to redirect back to the user app.
35
+
Microsoft Entra ID can be configured as a SAML provider for use with Amazon Cognito. Integrating Entra ID enables you to sign in with your existing enterprise users, and maintain profiles unique to the Amplify Auth resource for use within your Amplify app. To learn more, visit the [Azure documentation for SAML authentication with Microsoft Entra ID](https://learn.microsoft.com/en-us/entra/architecture/auth-saml).
36
36
37
-
</Callout>
37
+
## Start your personal cloud sandbox
38
38
39
39
To get started, define your Amplify Auth resource with the appropriate redirect URIs:
40
40
@@ -107,32 +107,63 @@ Deploy to your personal cloud sandbox with `npx ampx sandbox`. This will generat
107
107
}
108
108
```
109
109
110
+
## Set up Microsoft Entra ID
111
+
112
+
{/* @todo migrate to use sample Entra ID SAML Toolkit??? */}
113
+
110
114
Next, navigate to [portal.amazon.com](https://portal.azure.com/), select **Entra ID**. In your default directory, or company's existing directory, under **Manage**, select **Enterprise Applications**
111
115
112
-
{/* @TODO update screenshot for enterprise apps */}
113
-

116
+

117
+
118
+
Afterwards, select **New application**, then select **Create your own application**. Specify a name for the application and choose **Integrate any other application you don't find in the gallery (Non-gallery)**
119
+
120
+

121
+
122
+
Now that you have created the new enterprise application you can begin to configure Single Sign-on with SAML. Select **Single sign-on**
123
+
124
+

125
+
126
+
Then select **SAML**
127
+
128
+

114
129
115
-
Afterwards, select **New application**, then select **Create your own application**. Specify a name for the application and choose **Register an application to integrate with Entra ID (App you're developing)**
130
+
You will be directed to a page to set up single sign-on with SAML, which needs a few pieces of information from your Amplify Auth resource.
116
131
117
-

132
+

118
133
119
-
Select **Complete**. After being redirected to the **Register an application** form, specify a name for your Entra ID App -- this is the name of the app that will integrate with Amazon Cognito (e.g. `amplify-gen2-saml-with-entra-id`). Using the domain copied from the generated `amplify_outputs.json` file, specify a **Redirect URI (Optional)** as a **Web** redirect
134
+
In the **Basic SAML Configuration** step, select **Edit** and populate with the appropriate values.
[Learn more about configuring Amazon Cognito with SAML identity providers](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-saml-idp.html)
150
+
If you are using a custom domain the route remains the same: `/saml2/<action>`. [Learn more about configuring Amazon Cognito with SAML identity providers](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-saml-idp.html)
151
+
152
+
</Callout>
153
+
154
+
<Calloutwarning>
155
+
156
+
**Warning:** there is a known limitation where upstream sign-out functionality successfully signs out of Entra ID, but fails to redirect back to the user app. This behavior is disabled by default with SAML integrations in Amplify Auth.
130
157
131
158
</Callout>
132
159
133
-

160
+
Save the configuration and proceed to Step 3's **SAML Certificates** section. Copy the **App Federation Metadata Url**
161
+
162
+

163
+
164
+
## Configure Amplify Auth with Entra ID
134
165
135
-
Complete the Entra ID App registration by selecting **Register**.
166
+
Now that you've configured your SAML provider with Microsoft Entra ID and copied the **App Federation Metadata Url**, configure your Amplify Auth resource with the new SAML provider and paste the URL value into the `metadataContent` property:
User attributes can be found in Step 2's **Attributes & Claims** section, and are prefixed with a namespace by default. The example above shows mapping the default claim for the SAML user's email address, however additional attributes can be mapped.
197
+
198
+
## Optionally upload the Cognito Signing Certificate
199
+
200
+
In the AWS Console, navigate to your Cognito User Pool. Select the identity provider, **MicrosoftEntraIDSAML**, created after configuring Amplify Auth with the Entra ID SAML provider. Select **View signing certificate** and **download as .crt**
201
+
202
+

203
+
204
+
Rename the file extension to `.cer` in order to upload to Azure. On the **Single sign-on** page, scroll down to **Step 3** (**SAML Certificates**), and under **Verification Certificates (optional)**, select **Edit**.
205
+
206
+

207
+
208
+
Select **Require verification certificates** and upload the certificate.
209
+
210
+

211
+
212
+
Save your changes, and now requests to Entra ID from your Cognito User Pool will be verified.
213
+
214
+
## Connect your frontend
215
+
216
+
Now you're users are ready to sign in with Microsoft Entra ID. To sign in with this custom provider, specify the provider name as the name specified in your Amplify Auth definition: `MicrosoftEntraIDSAML`
0 commit comments