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
1. In Xcode, go to Project Settings → Signing & Capabilities
384
+
1. In Xcode, go to Project Settings → Your Target → Signing & Capabilities
385
385
2. Click +Capability
386
386
3. Add Keychain Sharing capability
387
387
4. Add a keychain group
@@ -390,7 +390,7 @@ To use a shared keychain:
390
390
To move to the shared keychain using this new keychain access group, specify the accessGroup parameter when instantiating the `AWSCognitoAuthPlugin`. If a user is currently signed-in, they will be logged out when first using the access group:
391
391
392
392
```swift
393
-
let accessGroup =AccessGroup(name: "\(teamID).com.example.sharedItems")
393
+
let accessGroup =AccessGroup(name: "\(teamID)com.example.sharedItems")
394
394
let secureStoragePreferences =AWSCognitoSecureStoragePreferences(
395
395
accessGroup: accessGroup)
396
396
try Amplify.add(
@@ -403,7 +403,7 @@ If you would prefer the user session to be migrated (which will allow the user t
403
403
404
404
```swift
405
405
let accessGroup =AccessGroup(
406
-
name: "\(teamID).com.example.sharedItems",
406
+
name: "\(teamID)com.example.sharedItems",
407
407
migrateKeychainItemsOfUserSession: true)
408
408
let secureStoragePreferences =AWSCognitoSecureStoragePreferences(
409
409
accessGroup: accessGroup)
@@ -421,8 +421,30 @@ To move to a different access group, update the name parameter of the AccessGrou
421
421
422
422
### Migrating from a Shared Keychain
423
423
424
-
If you’d like to stop sharing state between this app and other apps, you can set the access group to be `AccessGroup.none` or `AccessGroup.none(migrateKeychainItemsOfUserSession: true)` if you’d like the session to be migrated.
424
+
If you'd like to stop sharing state between this app and other apps, you can set the access group to be `AccessGroup.none` or `AccessGroup.none(migrateKeychainItemsOfUserSession: true)` if you'd like the session to be migrated.
425
425
426
+
### Retrieving Team ID
427
+
428
+
First, ensure your Info.plist has the `AppIdentifierPrefix` key:
429
+
430
+
```xml
431
+
<?xml version="1.0" encoding="UTF-8"?>
432
+
<!DOCTYPEplist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
433
+
<plistversion="1.0">
434
+
<dict>
435
+
<key>AppIdentifierPrefix</key>
436
+
<string>$(AppIdentifierPrefix)</string>
437
+
</dict>
438
+
</plist>
439
+
```
440
+
441
+
Then, you can retrieve the team ID from your Info.plist:
For the complete API documentation for Authentication module, visit our [API Reference](https://aws-amplify.github.io/amplify-js/api/modules/aws_amplify.auth.html)
0 commit comments