-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataStore sync fails on iOS with OIDC when IAM is specified as an additional provider #3967
Comments
I found the issue, because we specified IAM as an additional provider, the iOS Plugin expects Cognito to be configured and available to the app. However on Android this is not required and it shouldn't be, because our app only uses OICD for authorization and IAM is only used by server side functions. So my question is if this is intended behavior and if there is a different way to specify which authorization modes are actually relevant for the client side. |
Hi @thoschwa, I'm glad your issue is resolved. I will look into whether or not this is expected behavior on the iOS side and get back to you. |
Any update on that? @khatruong2009 |
Hi @thoschwa, thanks for the details. DataStore supports multi-auth which is enabled through the configuration flag final datastorePlugin = AmplifyDataStore(
modelProvider: ModelProvider.instance,
authModeStrategy: AuthModeStrategy.multiAuth,
); Since you do not have it enabled, it should do its determination based on the API's default authorization type in the configuration. Since your configuration's default authorization is
I think it's a bug that it's requiring you to have auth plugin despite not having multiauth enabled on the DataStore configuration. Currently it should use the default authorization mode on the API which is OIDC. I'm working on a fix that should work with your current set up. It would be a feature request for selecting which auth modes to use on the client side, since the generated file has all the relevant auth rules for that model. A workaround would be to manually remove the auth rule from the generated file that you don't want the client to know about. Multi-auth flag should be set to true if you have more than one auth mode you want enabled on the client side. |
the fix has been released in Amplify Swift 1.30.7. https://github.com/aws-amplify/amplify-swift/releases/tag/1.30.7 |
Description
When starting the app I get:
This issue occurs only on iOS, on Android it is working as expected. The API works fine, so when requesting the same data via the API plugin everything works, so it seams to be DataStore related.
This is how I configure Amplify before
runApp
in mymain.dart
:and my
amplifyconfiguration.dart
:I have also followed the guide on Getting started with Amplify and Flutter and have completed all the steps mentioned.
Categories
Steps to Reproduce
Screenshots
No response
Platforms
Flutter Version
3.13.7
Amplify Flutter Version
1.4.1
Deployment Method
Amplify CLI
Schema
The text was updated successfully, but these errors were encountered: