Add config option for keychain sharing
nikola-mladenovic opened this issue · 0 comments
In situations where the app using Commercetools SDK has extensions (such as today extension, notification content extension, etc), we want to enable our users to seamlessly use endpoints from the SDK in those extensions with the same auth tokens.
Common use cases:
- An app has a rich notification, which needs to retrieve an object from our API in order to display the rich content;
- An app has a today widget, which would like to show an overview of reservations ready for pickup, etc;
In any of those cases, the user has previously logged in using the app, but since the app and the extension run in a different sandbox, the extension wouldn't be able to get the data needed from the API, because it doesn't contain proper auth tokens.
The solution for this problem is to allow SDK users to setup keychain sharing and specify keychain group in the SDK plist config. As a result, the SDK won't store the tokens in the default location, but in the shared keychain, making it accessible by both the app and the extension.