Skip to content

Commit 6bc5bc5

Browse files
authored
Revert: Apple sign-in (#7348)
* Revert "feat: Support for Apple Sign In (#7265)"
1 parent 188efdd commit 6bc5bc5

25 files changed

Lines changed: 77 additions & 626 deletions

File tree

packages/amplify-category-auth/resources/cloudformation-templates/auth-template.yml.ejs

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -589,27 +589,16 @@ Resources:
589589
- ' let providerCredsIndex = hostedUIProviderCreds.findIndex((provider) => provider.ProviderName === providerName);'
590590
- ' let providerCreds = hostedUIProviderCreds[providerCredsIndex];'
591591
- ' let requestParams = {'
592+
- ' ProviderDetails: {'
593+
- ' ''client_id'': providerCreds.client_id,'
594+
- ' ''client_secret'': providerCreds.client_secret,'
595+
- ' ''authorize_scopes'': providerMeta.authorize_scopes'
596+
- ' },'
592597
- ' ProviderName: providerMeta.ProviderName,'
593598
- ' UserPoolId: userPoolId,'
594-
- ' AttributeMapping: providerMeta.AttributeMapping,'
599+
- ' AttributeMapping: providerMeta.AttributeMapping'
595600
- ' };'
596-
- ' let providerDetails;'
597-
- ' if (providerMeta.ProviderName === ''SignInWithApple'') {'
598-
- ' providerDetails = {'
599-
- ' ''client_id'': providerCreds.client_id,'
600-
- ' ''team_id'': providerCreds.team_id,'
601-
- ' ''key_id'': providerCreds.key_id,'
602-
- ' ''private_key'': providerCreds.private_key,'
603-
- ' ''authorize_scopes'': providerMeta.authorize_scopes,'
604-
- ' };'
605-
- ' } else {'
606-
- ' providerDetails = {'
607-
- ' ''client_id'': providerCreds.client_id,'
608-
- ' ''client_secret'': providerCreds.client_secret,'
609-
- ' ''authorize_scopes'': providerMeta.authorize_scopes,'
610-
- ' };'
611-
- ' }'
612-
- ' return { ProviderDetails: providerDetails, ...requestParams };'
601+
- ' return requestParams;'
613602
- ' };'
614603
- ' let createIdentityProvider = (providerName) => {'
615604
- ' let requestParams = getRequestParams(providerName);'
@@ -1123,9 +1112,6 @@ Resources:
11231112
<%if (props.authProviders.indexOf('www.amazon.com') !== -1) { %>
11241113
www.amazon.com: !Ref amazonAppId
11251114
<% } %>
1126-
<%if (props.authProviders.indexOf('appleid.apple.com') !== -1) { %>
1127-
appleid.apple.com: !Ref appleAppId
1128-
<% } %>
11291115
<% } %>
11301116
AllowUnauthenticatedIdentities: !Ref allowUnauthenticatedIdentities
11311117
<%if (props.audiences && props.audiences.length > 0) { %>
@@ -1208,8 +1194,4 @@ Outputs :
12081194
AmazonWebClient:
12091195
Value: !Ref amazonAppId
12101196
<% } %>
1211-
<%if (props.appleAppId) { %>
1212-
AppleWebClient:
1213-
Value: !Ref appleAppId
1214-
<% } %>
12151197
<% } %>

packages/amplify-category-auth/src/provider-utils/awscloudformation/assets/string-maps.js

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ const attributeProviderMap = {
136136
facebook: {},
137137
google: {},
138138
loginwithamazon: {},
139-
signinwithapple: {},
140139
},
141140
birthdate: {
142141
facebook: {
@@ -148,7 +147,6 @@ const attributeProviderMap = {
148147
scope: 'profile',
149148
},
150149
loginwithamazon: {},
151-
signinwithapple: {},
152150
},
153151
email: {
154152
facebook: {
@@ -163,10 +161,6 @@ const attributeProviderMap = {
163161
attr: 'email',
164162
scope: 'profile',
165163
},
166-
signinwithapple: {
167-
attr: 'email',
168-
scope: 'email',
169-
},
170164
},
171165
family_name: {
172166
facebook: {
@@ -178,10 +172,6 @@ const attributeProviderMap = {
178172
scope: 'profile',
179173
},
180174
loginwithamazon: {},
181-
signinwithapple: {
182-
attr: 'lastName',
183-
scope: 'name',
184-
},
185175
},
186176
gender: {
187177
facebook: {
@@ -193,7 +183,6 @@ const attributeProviderMap = {
193183
scope: 'profile',
194184
},
195185
loginwithamazon: {},
196-
signinwithapple: {},
197186
},
198187
given_name: {
199188
facebook: {
@@ -205,10 +194,6 @@ const attributeProviderMap = {
205194
scope: 'profile',
206195
},
207196
loginwithamazon: {},
208-
signinwithapple: {
209-
attr: 'firstName',
210-
scope: 'name',
211-
},
212197
},
213198
locale: {
214199
facebook: {},
@@ -217,7 +202,6 @@ const attributeProviderMap = {
217202
attr: 'postal_code',
218203
scope: 'postal_code',
219204
},
220-
signinwithapple: {},
221205
},
222206
middle_name: {
223207
facebook: {
@@ -226,7 +210,6 @@ const attributeProviderMap = {
226210
},
227211
google: {},
228212
loginwithamazon: {},
229-
signinwithapple: {},
230213
},
231214
name: {
232215
facebook: {
@@ -241,13 +224,11 @@ const attributeProviderMap = {
241224
attr: 'name',
242225
scope: 'profile',
243226
},
244-
signinwithapple: {},
245227
},
246228
nickname: {
247229
facebook: {},
248230
google: {},
249231
loginwithamazon: {},
250-
signinwithapple: {},
251232
},
252233
phone_number: {
253234
facebook: {},
@@ -256,7 +237,6 @@ const attributeProviderMap = {
256237
scope: 'profile',
257238
},
258239
loginwithamazon: {},
259-
signinwithapple: {},
260240
},
261241
picture: {
262242
facebook: {
@@ -268,31 +248,26 @@ const attributeProviderMap = {
268248
scope: 'profile',
269249
},
270250
loginwithamazon: {},
271-
signinwithapple: {},
272251
},
273252
preferred_username: {
274253
facebook: {},
275254
google: {},
276255
loginwithamazon: {},
277-
signinwithapple: {},
278256
},
279257
profile: {
280258
facebook: {},
281259
google: {},
282260
loginwithamazon: {},
283-
signinwithapple: {},
284261
},
285262
zoneinfo: {
286263
facebook: {},
287264
google: {},
288265
loginwithamazon: {},
289-
signinwithapple: {},
290266
},
291267
website: {
292268
facebook: {},
293269
google: {},
294270
loginwithamazon: {},
295-
signinwithapple: {},
296271
},
297272
username: {
298273
facebook: {
@@ -307,7 +282,6 @@ const attributeProviderMap = {
307282
attr: 'user_id',
308283
scope: 'profile:user_id',
309284
},
310-
signinwithapple: {},
311285
},
312286
updated_at: {
313287
facebook: {
@@ -316,7 +290,6 @@ const attributeProviderMap = {
316290
},
317291
google: {},
318292
loginwithamazon: {},
319-
signinwithapple: {},
320293
},
321294
};
322295

@@ -419,11 +392,6 @@ const authProviders = [
419392
value: 'www.amazon.com',
420393
answerHashKey: 'amazonAppId',
421394
},
422-
{
423-
name: 'Apple',
424-
value: 'appleid.apple.com',
425-
answerHashKey: 'appleAppId',
426-
},
427395
];
428396

429397
const hostedUIProviders = [
@@ -439,10 +407,6 @@ const hostedUIProviders = [
439407
name: 'Login With Amazon',
440408
value: 'LoginWithAmazon',
441409
},
442-
{
443-
name: 'Sign in with Apple',
444-
value: 'SignInWithApple',
445-
},
446410
];
447411

448412
const authorizeScopes = [

packages/amplify-category-auth/src/provider-utils/awscloudformation/constants.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ export const ENV_SPECIFIC_PARAMS = [
1919
'amazonAppId',
2020
'loginwithamazonAppIdUserPool',
2121
'loginwithamazonAppSecretUserPool',
22-
'signinwithappleClientIdUserPool',
23-
'signinwithappleTeamIdUserPool',
24-
'signinwithappleKeyIdUserPool',
25-
'signinwithapplePrivateKeyUserPool',
2622
'hostedUIProviderCreds',
2723
];
2824

@@ -59,10 +55,6 @@ export const privateKeys = [
5955
'loginwithamazonAppIdUserPool',
6056
'loginwithamazonAuthorizeScopes',
6157
'loginwithamazonAppSecretUserPool',
62-
'signinwithappleClientIdUserPool',
63-
'signinwithappleTeamIdUserPool',
64-
'signinwithappleKeyIdUserPool',
65-
'signinwithapplePrivateKeyUserPool',
6658
'CallbackURLs',
6759
'LogoutURLs',
6860
'AllowedOAuthFlows',

packages/amplify-category-auth/src/provider-utils/awscloudformation/import/index.ts

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { importMessages } from './messages';
2727
import uuid from 'uuid';
2828

2929
// Currently the CLI only supports the output generation of these providers
30-
const supportedIdentityProviders = ['COGNITO', 'Facebook', 'Google', 'LoginWithAmazon', 'SignInWithApple'];
30+
const supportedIdentityProviders = ['COGNITO', 'Facebook', 'Google', 'LoginWithAmazon'];
3131

3232
export const importResource = async (
3333
context: $TSContext,
@@ -752,9 +752,6 @@ const createMetaOutput = (answers: ImportAnswers, hasOAuthConfig: boolean): Meta
752752
case 'accounts.google.com':
753753
output.GoogleWebClient = answers.identityPool!.SupportedLoginProviders![key];
754754
break;
755-
case 'appleid.apple.com':
756-
output.AppleWebClient = answers.identityPool!.SupportedLoginProviders![key];
757-
break;
758755
default:
759756
// We don't do anything with the providers that the CLI currently does not support.
760757
break;
@@ -818,9 +815,6 @@ const createEnvSpecificResourceParameters = (
818815
case 'graph.facebook.com':
819816
envSpecificResourceParameters.facebookAppId = answers.identityPool!.SupportedLoginProviders![key];
820817
break;
821-
case 'appleid.apple.com':
822-
envSpecificResourceParameters.appleAppId = answers.identityPool!.SupportedLoginProviders![key];
823-
break;
824818
case 'accounts.google.com': {
825819
switch (projectType) {
826820
case 'javascript':
@@ -846,23 +840,11 @@ const createEnvSpecificResourceParameters = (
846840
};
847841

848842
const createOAuthCredentials = (identityProviders: IdentityProviderType[]): string => {
849-
const credentials = identityProviders.map(idp => {
850-
if (idp.ProviderName === 'SignInWithApple') {
851-
return {
852-
ProviderName: idp.ProviderName!,
853-
client_id: idp.ProviderDetails!.client_id,
854-
team_id: idp.ProviderDetails!.team_id,
855-
key_id: idp.ProviderDetails!.key_id,
856-
private_key: idp.ProviderDetails!.private_key,
857-
};
858-
} else {
859-
return {
860-
ProviderName: idp.ProviderName!,
861-
client_id: idp.ProviderDetails!.client_id,
862-
client_secret: idp.ProviderDetails!.client_secret,
863-
};
864-
}
865-
});
843+
const credentials = identityProviders.map(idp => ({
844+
ProviderName: idp.ProviderName!,
845+
client_id: idp.ProviderDetails!.client_id,
846+
client_secret: idp.ProviderDetails!.client_secret,
847+
}));
866848

867849
return JSON.stringify(credentials);
868850
};

packages/amplify-category-auth/src/provider-utils/awscloudformation/import/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export type MetaOutput = {
4444
AmazonWebClient?: string;
4545
FacebookWebClient?: string;
4646
GoogleWebClient?: string;
47-
AppleWebClient?: string;
4847
HostedUIDomain?: string;
4948
OAuthMetadata?: string;
5049
CreatedSNSRole?: string;
@@ -60,7 +59,6 @@ export type EnvSpecificResourceParameters = {
6059
identityPoolName?: string;
6160
facebookAppId?: string;
6261
amazonAppId?: string;
63-
appleAppId?: string;
6462
googleIos?: string;
6563
googleAndroid?: string;
6664
googleClientId?: string;

0 commit comments

Comments
 (0)