Skip to content

Commit

Permalink
fix(amplify-category-auth): check for siwa Cognito idp params (aws-am…
Browse files Browse the repository at this point in the history
…plify#7678)

Need to check for siwa params because privateKey is not returned from Cognito, so it may not always
be available. Worst case the user will need to re-configure SIWA in a new environment for amplify
init.

Co-authored-by: David Lopez <lopezbnd@amazon.com>
  • Loading branch information
2 people authored and cjihrig-aws committed Jul 12, 2021
1 parent 2f175b8 commit bcdce1e
Showing 1 changed file with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -594,13 +594,17 @@ Resources:
- ' AttributeMapping: providerMeta.AttributeMapping,'
- ' };'
- ' if (providerMeta.ProviderName === ''SignInWithApple'') {'
- ' requestParams.ProviderDetails = {'
- ' ''client_id'': providerCreds.client_id,'
- ' ''team_id'': providerCreds.team_id,'
- ' ''key_id'': providerCreds.key_id,'
- ' ''private_key'': providerCreds.private_key,'
- ' ''authorize_scopes'': providerMeta.authorize_scopes,'
- ' };'
- ' if (providerCreds.client_id && providerCreds.team_id && providerCreds.key_id && providerCreds.private_key) {'
- ' requestParams.ProviderDetails = {'
- ' ''client_id'': providerCreds.client_id,'
- ' ''team_id'': providerCreds.team_id,'
- ' ''key_id'': providerCreds.key_id,'
- ' ''private_key'': providerCreds.private_key,'
- ' ''authorize_scopes'': providerMeta.authorize_scopes,'
- ' };'
- ' } else {'
- ' requestParams = null;'
- ' }'
- ' } else {'
- ' requestParams.ProviderDetails = {'
- ' ''client_id'': providerCreds.client_id,'
Expand All @@ -612,11 +616,17 @@ Resources:
- ' };'
- ' let createIdentityProvider = (providerName) => {'
- ' let requestParams = getRequestParams(providerName);'
- ' if (!requestParams) {'
- ' return Promise.resolve();'
- ' }'
- ' requestParams.ProviderType = requestParams.ProviderName;'
- ' return identity.createIdentityProvider(requestParams).promise();'
- ' };'
- ' let updateIdentityProvider = (providerName) => {'
- ' let requestParams = getRequestParams(providerName);'
- ' if (!requestParams) {'
- ' return Promise.resolve();'
- ' }'
- ' return identity.updateIdentityProvider(requestParams).promise();'
- ' };'
- ' let deleteIdentityProvider = (providerName) => {'
Expand Down

0 comments on commit bcdce1e

Please sign in to comment.