Skip to content

Commit 55c50de

Browse files
authored
fix: update attribute mapping section (#8268)
1 parent fc30fb4 commit 55c50de

File tree

1 file changed

+7
-5
lines changed
  • src/pages/[platform]/build-a-backend/auth/concepts/external-identity-providers

1 file changed

+7
-5
lines changed

src/pages/[platform]/build-a-backend/auth/concepts/external-identity-providers/index.mdx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,13 @@ export const auth = defineAuth({
314314

315315
### Attribute mapping
316316

317-
You can map which attributes are mapped between your external identity provider and your users created in Cognito. We will be able to have the best level of protection for developers if we ensure that attribute mappings that would not work are called out by the type system.
317+
Identity provider (IdP) services store user attributes in different formats. When using external IdPs with Amazon Cognito user pools, attribute mapping allows you to standardize these varying formats into a consistent schema.
318318

319-
<Callout>
319+
Learn more about [mapping IdP attributes to user pool profiles and tokens](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-specifying-attribute-mapping.html).
320+
321+
<Callout warning>
320322

321-
If you specify an attribute in your authentication resource as required, and it is not allowed for your external providers, signing in with that external provider will cause an error.
323+
**Note:** When a federated user signs in to your application, a mapping must be present for each attribute that your user pool requires. Additionally, you must also ensure that the target of each attribute mapping is mutable. Amazon Cognito will attempt to update each mapped attribute when a user signs in regardless of whether the latest value already matches the existing information. If these criteria are not met, Amazon Cognito will return an error and the sign in attempt will fail.
322324

323325
</Callout>
324326

@@ -330,7 +332,7 @@ import { defineAuth } from '@aws-amplify/backend';
330332
export const auth = defineAuth({
331333
loginWith: {
332334
email: true,
333-
externalAuthProviders: {
335+
externalProviders: {
334336
loginWithAmazon: {
335337
clientId: secret('LOGINWITHAMAZON_CLIENT_ID'),
336338
clientSecret: secret('LOGINWITHAMAZON_CLIENT_SECRET'),
@@ -359,7 +361,7 @@ import { defineAuth } from '@aws-amplify/backend';
359361
export const auth = defineAuth({
360362
loginWith: {
361363
email: true,
362-
externalAuthProviders: {
364+
externalProviders: {
363365
loginWithAmazon: {
364366
clientId: secret('LOGINWITHAMAZON_CLIENT_ID'),
365367
clientSecret: secret('LOGINWITHAMAZON_CLIENT_SECRET'),

0 commit comments

Comments
 (0)