Git Product home page Git Product logo

flutter_cognito_plugin's People

Contributors

ctrysbita avatar dbbd59 avatar devxpy avatar jakealmer avatar srimajji avatar tisrnd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

flutter_cognito_plugin's Issues

unexpected character in attributes field

/flutter ( 9995): #12     TapGestureRecognizer.handleTapUp (package:flutter/src
I/flutter ( 9995): FormatException: Unexpected character (at character 1)
I/flutter ( 9995): [email protected]
I/flutter ( 9995): ^
I/flutter ( 9995): #0      _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1405:5)
I/flutter ( 9995): #1      _ChunkedJsonParser.parseNull (dart:convert-patch/convert_patch.dart:996:7)
I/flutter ( 9995): #2      _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:879:22)
I/flutter ( 9995): #3      _parseJson (dart:convert-patch/convert_patch.dart:40:10)
I/flutter ( 9995): #4      JsonDecoder.convert (dart:convert/json.dart:506:36)
I/flutter ( 9995): #5      JsonCodec.decode (dart:convert/json.dart:157:41)
I/flutter ( 9995): #6      jsonDecode (dart:convert/json.dart:96:10)
I/flutter ( 9995): #7      MyAppState.signUp.<anonymous closure> (package:flutter_cognito_plugin_example/main.dart:166:61)
I/flutter ( 9995): #8      MyAppState.onPressWrapper.wrapper (package:flutter_cognito_plugin_example/main.dart:109:26)
I/flutter ( 9995): #9      MyAppState.onPressWrapper.wrapper (package:flutter_cognito_plugin_example/main.dart:102:12)
I/flutter ( 9995): #10     _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:989:21)
I/flutter ( 9995): #11     GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:193:24)
I/flutter ( 9995): #12     TapGestureRecognizer.handleTapUp (package:flutter/src

release process fails with Unresolved reference

Hi,

I'm having problems during the release process, the Gradle task failing is compileReleaseKotlin.

I suppose is kind of a misconfiguration do you have any idea?
thx

.pub-cache/hosted/pub.dartlang.org/flutter_cognito_plugin-.pub-cache/hosted/pub.dartlang.org/flutter_cognito_plugin-2.2.0/android/src/main/kotlin/com/pycampers/flutter_cognito_plugin/Cognito.kt: (18, 22): Unresolved reference: plugin_scaffold
.pub-cache/hosted/pub.dartlang.org/flutter_cognito_plugin-2.2.0/android/src/main/kotlin/com/pycampers/flutter_cognito_plugin/Cognito.kt: (29, 17): Unresolved reference: trySend
.pub-cache/hosted/pub.dartlang.org/flutter_cognito_plugin-2.2.0/android/src/main/kotlin/com/pycampers/flutter_cognito_plugin/Cognito.kt: (33, 17): Unresolved reference: sendThrowable

Federated SignIn with Google Sign In, returns no errors, but can't see user in user pool

Hi,

I have cloned the example app and I have added awsconfiguration.json file with my cognito info.

I then tried using sign up (i.e. email + password) and this worked, and my user was shown in my user pool.

I then added in google_sign_in package:

google_sign_in: ^4.2.0

And did the necessary config.

I ended up using the code below:

signInGoogle() async { final dynamic result = await signInWithGoogle(); Cognito .federatedSignIn('accounts.google.com', result.idToken) .then((res) { print(res); }).catchError((dynamic error) { print(error); }); }

I get a "flutter: UserState.SIGNED_IN" back and the state shows that I'm signed in.

I then go under my groups, e.g.

Groups => eu-west-xxx_Google

But I don't see the user.

I don't have any errors in the app, and so was wondering if you could point me in the right direction to get this working.

Thanks, Robert

Update:

From what I see the user is not logged in, although the federatedSignIn simply returns "UserState.SIGNED_IN" as a response.

RuntimeException: Failed to read awsconfiguration.json please check that it is correctly formed.

Until a few hours ago where I made a pub get to refresh my dependencies, this was working fine. I currently have my awsconfiguration.json file within the res/raw directory inside of my android file when running 'flutter run' within the console, it throws the following error:

I/flutter (16510): java.lang.RuntimeException: Failed to read awsconfiguration.json please check that it is correctly formed.
I/flutter (16510):      at com.amazonaws.mobile.config.AWSConfiguration.readInputJson(AWSConfiguration.java:125)
I/flutter (16510):      at com.amazonaws.mobile.config.AWSConfiguration.<init>(AWSConfiguration.java:109)
I/flutter (16510):      at com.amazonaws.mobile.config.AWSConfiguration.<init>(AWSConfiguration.java:94)
I/flutter (16510):      at com.amazonaws.mobile.config.AWSConfiguration.<init>(AWSConfiguration.java:71)
I/flutter (16510):      at com.amazonaws.mobile.client.AWSMobileClient.initialize(AWSMobileClient.java:434)
I/flutter (16510):      at com.pycampers.flutter_cognito_plugin.Cognito.initialize(Cognito.kt:22)
I/flutter (16510):      at java.lang.reflect.Method.invoke(Native Method)
I/flutter (16510):      at com.pycampers.plugin_scaffold.PluginScaffoldPluginKt$createPluginScaffold$1$$special$$inlined$let$lambda$1.invoke(PluginScaffoldPlugin.kt:75)
I/flutter (16510):      at com.pycampers.plugin_scaffold.PluginScaffoldPluginKt$createPluginScaffold$1$$special$$inlined$let$lambda$1.invoke(Unknown
I/flutter (16510): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
I/flutter (16510): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
I/flutter (16510): <asynchronous suspension>                            
I/flutter (16510): #2      Cognito.invokeMethodWithChannel (package:flutter_cognito_plugin/flutter_cognito_plugin.dart:70:30)
I/flutter (16510): #3      Cognito.invokeMethod (package:flutter_cognito_plugin/flutter_cognito_plugin.dart:86:12)
I/flutter (16510): #4      Cognito.initialize (package:flutter_cognito_plugin/flutter_cognito_plugin.dart:107:11)
I/flutter (16510): #5      MyAppState.doLoad (package:flutter_cognito_plugin_example/main.dart:30:29)
I/flutter (16510): #6      MyAppState.initState (package:flutter_cognito_plugin_example/main.dart:54:5)
I/flutter (16510): #7      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4355:58)
I/flutter (16510): #8      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
I/flutter (16510): #9      Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
I/flutter (16510): #10     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)

This then stops initialization within the app and once the user tries to install the apk on an android device, they get a MissingPluginException from flutter. This also occurs currently in the example app when being installed.

Cognito iOS SDK 2.18.1 (Bug Fix)

Hello, this is really a question more than an issue. I need to pick up a critical bug fix that went into the latest version 2.18.1 of the iOS SDK for Cognito -- https://github.com/aws-amplify/aws-sdk-ios/blob/main/CHANGELOG.md

The bug fix I need is here -- aws-amplify/aws-sdk-ios#2886
The PR is here -- aws-amplify/aws-sdk-ios#3190

The bug impacts iOS only, not Android.

It looks like the current podpsec for flutter_cognito_plugin points to version 2.13, so this will be a big jump to 2.18:

  s.dependency 'AWSMobileClient', '~> 2.13.0'
  s.dependency 'AWSAuth', '~> 2.13.0'
  s.dependency 'AWSCognito', '~> 2.13.0'
  s.dependency 'AWSAuthUI', '~> 2.13.0'
  s.dependency 'AWSUserPoolsSignIn', '~> 2.13.0'

I can open a PR and run the example app, but is there is any other recommendation on process to do the upgrade?

Thanks in advance for your help, and thanks again for the great library.

Activity not found

hi i got the following error

package identifier or launch activity not found.
Please check /home/flow/prj/testaws/android/app/src/main/AndroidManifest.xml for errors.
No application found for TargetPlatform.android_x64.
Is your project missing an android/app/src/main/AndroidManifest.xml?
Consider running "flutter create ." to create one.

MainActivity

package com.example.testaws

import androidx.annotation.NonNull
import com.pycampers.flutter_cognito_plugin.CognitoPluginActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity: CognitoPluginActivity("testaws") {
    override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
        GeneratedPluginRegistrant.registerWith(flutterEngine);
    }
}

AndroidManifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.testaws">
    <!-- io.flutter.app.FlutterApplication is an android.app.Application that
         calls FlutterMain.startInitialization(this); in its onCreate method.
         In most cases you can leave this as-is, but you if you want to provide
         additional functionality it is fine to subclass or reimplement
         FlutterApplication and put your custom class here. -->
    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="testaws"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <!-- Displays an Android View that continues showing the launch screen
                 Drawable until Flutter paints its first frame, then this splash
                 screen fades out. A splash screen is useful to avoid any visual
                 gap between the end of Android's launch screen and the painting of
                 Flutter's first frame. -->
            <meta-data
              android:name="io.flutter.embedding.android.SplashScreenDrawable"
              android:resource="@drawable/launch_background"
              />
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="testaws" />
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

Disable logs to logcat

I having a problem with security requirements of my app, because any time i call the signIn method the user credentials are logged by invoke method in debug console and in android logcat.
Is there any way to disable this behavior, because it is preventing my release.

This is an example of what is shown:
PluginScaffold D invoke { channel: com.pycampers.flutter_cognito_plugin, method: signIn(), args: {password=PASSWORD123, username=USERNAME} }

The app is working on iPhone XS but giving error on iPhone 11 and others method are working fine

D/PluginScaffold: invoking { channel: com.pycampers.flutter_cognito_plugin, method: signIn(), args: Optional({
password = 123456;
username = "[email protected]";
}) }
D/PluginScaffold: piping exception to flutter (Cannot set the result on a completed task.
(
0 CoreFoundation 0x00000001942a6768 4FBDF167-161A-324C-A233-D516922C67E5 + 1218408
1 libobjc.A.dylib 0x00000001a8d6d7a8 objc_exception_throw + 60
2 CoreFoundation 0x000000019419b7e0 4FBDF167-161A-324C-A233-D516922C67E5 + 124896
3 AWSMobileClient 0x0000000100cb08fc $s15AWSMobileClientAAC6signIn8username8password14validationData17completionHandlerySS_SSSDyS2SGSgyAA04SignD6ResultVSg_s5Error_pSgtctF + 1236
4 flutter_cognito_plugin 0x000000010caa2818 $s22flutter_cognito_plugin7CognitoC6signIn4call6resultySo17FlutterMethodCallC_yypSgctF + 636
5 flutter_cognito_plugin 0x000000010caa8770 $sSo17FlutterMethodCallCypSgIegn_Ieggg_ABxq_r0_lyACytIsegnr_ytIegnnr_TRTA + 88
6 plugin_scaffold 0x000000010cb31f54 $s15plugin_scaffold20createPluginScaffold9messenger11channelName9methodMapSo20FlutterMethodChannelCSo0K15BinaryMessenger_p_SSSDySSypGtFySo0kL4CallC_yypSgctcfU_yycfU_TA + 4532
7 plugin_scaffold 0x000000010cb30834 $s15plugin_scaffold11catchErrorsyyyypSgc_yyKctFyycfU_TA + 44
8 plugin_scaffold 0x000000010cb2f9a4 $sIeg_IeyB_TR + 20
9 plugin_scaffold 0x000000010cb2ed9c +[PluginScaffoldHelper tryCatch:onCatch:onElse:]

  • 72
    10 plugin_scaffold 0x000000010cb2f958 $s15plugin_scaffold11catchErrorsyyyypSgc_yyKctF + 356
    11 plugin_scaffold 0x000000010cb30ccc $s15plugin_scaffold20createPluginScaffold9messenger11channelName9methodMapSo20FlutterMethodChannelCSo0K15BinaryMessenger_p_SSSDySSypGtFySo0kL4CallC_yypSgctcfU_TA + 148
    12 plugin_scaffold 0x000000010cb30380 $sSo17FlutterMethodCallCypSgIegn_Ieggg_AByXlSgIeyBy_IeyByy_TR + 96
    13 Flutter 0x0000000101479958 Flutter + 5560664
    14 Flutter 0x0000000100f5c618 Flutter + 198168
    15 Flutter 0x0000000101222f6c Flutter + 3108716
    16 Flutter 0x0000000100f656c4 Flutter + 235204
    17 Flutter 0x0000000100f6733c Flutter + 242492
    18 CoreFoundation 0x000000019422122c 4FBDF167-161A-324C-A233-D516922C67E5 + 672300
    19 CoreFoundation 0x0000000194220e28 4FBDF167-161A-324C-A233-D516922C67E5 + 671272
    20 CoreFoundation 0x0000000194220278 4FBDF167-161A-324C-A233-D516922C67E5 + 668280
    21 CoreFoundation 0x000000019421a02c 4FBDF167-161A-324C-A233-D516922C67E5 + 643116
    22 CoreFoundation 0x0000000194219360 CFRunLoopRunSpecific + 600
    23 GraphicsServices 0x00000001ab857734 GSEventRunModal + 164
    24 UIKitCore 0x0000000196c94584 33B02AB5-5DAF-3249-8DC6-5872DF830EC5 + 12363140
    25 UIKitCore 0x0000000196c99df4 UIApplicationMain + 168
    26 Runner 0x0000000100347558 main + 64
    27 libdyld.dylib 0x0000000193ed5cf8 E574A365-9878-348A-8E84-91E163CFC128 + 7416
    ))
    2021-06-23 14:19:39.616336+0530 Runner[5314:1435083] [VERBOSE-2:ui_dart_state.cc(166)] Unhandled Exception: type 'PlatformException' is not a subtype of type 'String'
    #0 CognitoService.signIn (package:qure/services/cognito_service.dart:173)

changePassword method usage

Can the changePassword(String oldPassword, String newPassword) method be used to update a user's password when their SignInState is SignInState.NEW_PASSWORD_REQUIRED?

MissingPluginException when creating a .APK.

The plugin works fine if using the android emulator, however once generating an apk using "flutter build apk", an exception is thrown where it cannot find the corresponding plugin. I have tested other plugins and it seems that this is the only one that is not working in this manner.

Android - Using AppSync causes user to log out

This problem does not occur with iOS.

So I can log in to a user account, but when I do anything with AppSync, the UserState will change to UserState.SIGNED_OUT

I already gave up and switched to another plugin that does not have this problem.

Support guest/unauthorized user?

Is there a way to allow un-authorized users for read-only operations?

Similar to -> aws-amplify/amplify-js#711

const client = new AWSAppSyncClient({
    url: AppSync.graphqlEndpoint,
    region: AppSync.region,
    auth: {
        // Amazon Cognito Federated Identities using AWS Amplify
        credentials: () => Auth.currentCredentials()
    },
});

social login in iOs doesnt get token

I'm trying social login at iOs but when I done login with google and then callback to my application the additionalInfo is null without token, this work fina at Android.

image

dependencies:
  flutter:
    sdk: flutter
  amplify_flutter: ^0.2.0
  amplify_auth_cognito: ^0.2.0
$ flutter --version
Flutter 2.2.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f4abaa0735 (3 weeks ago) • 2021-07-01 12:46:11 -0700
Engine • revision 241c87ad80
Tools • Dart 2.13.4

                  try {
                    var res = await Amplify.Auth.signInWithWebUI(
                        provider: AuthProvider.google);

                    print(res);
                    print(
                        'TOKEN: ${res.nextStep?.additionalInfo['token'] ?? ''}');
                  } on AmplifyException catch (e) {
                    print(e.message);
                  } catch (e) {
                    print(e);
                  }

Sign in to identity pool with OpenId

Hi, I am trying to integrate aws with firebase as an identity provider. On flutter side I am using the firebase_auth package with the following code:

FirebaseUser user = await FirebaseAuth.instance.currentUser();
String fb_token;
user.getIdToken().then((result) {
  fb_token = result.token;
});

Now I am trying to connect to aws via an Identity pool. I am following the approach outlined in this SO post: https://stackoverflow.com/questions/47228334/firebase-as-identity-provider-with-cognito-aws/47252192
But so far I haven't had any luck finding a dart package that would support connecting to cognito with openId and identity pools. Does this package also support identity pools or only user pools? Do you have any other suggestions/advice on how to solve this problem or am I perhaps missing something?

Many thanks!

Federated SignIn with Google Sign In return error

Hi,

I'm using this code

var res = await Cognito.federatedSignIn('accounts.google.com', token.idToken);

and I receive error "Token is not from a supported provider of this identity pool" but I've checked my user pool>Identity provider and identity pool>authentication provider both are configured.

May I know what might be the reason that I'm getting this error?
Do I need to add google info into the awsconfiguration.json as well?If yes can anyone please show me the sample. Thanks!
Below are the awsconfiguration.json sample I'm using

{
"IdentityManager": {
"Default": {}
},
"CredentialsProvider": {
"CognitoIdentity": {
"Default": {
"PoolId": "XX-XXXX-X:XXXXXXXX-XXXX-1234-abcd-1234567890ab",
"Region": "XX-XXXX-X"
}
}
},
"CognitoUserPool": {
"Default": {
"PoolId": "XX-XXXX-X_abcd1234",
"AppClientId": "XXXXXXXX",
"AppClientSecret": "XXXXXXXXX",
"Region": "XX-XXXX-X"
}
}
}

Error when implementing Hosted UI

Hello flutter cognito plugin team! Would you mind helping me with something? When I want to call a hosted UI using

Cognito.showSignIn(
    identityProvider: "google",
    scopes: ["email", "openid"],
);

I get this error:

D/AWSMobileClient(18123): getHostedUIJSON: Failed to read config
D/AWSMobileClient(18123): java.lang.NullPointerException: Attempt to invoke virtual method 'org.json.JSONObject com.amazonaws.mobile.config.AWSConfiguration.optJsonObject(java.lang.String)' on a null object reference
D/AWSMobileClient(18123): 	at com.amazonaws.mobile.client.AWSMobileClient.getHostedUIJSONFromJSON(AWSMobileClient.java:641)
D/AWSMobileClient(18123): 	at com.amazonaws.mobile.client.AWSMobileClient.getHostedUIJSON(AWSMobileClient.java:660)
D/AWSMobileClient(18123): 	at com.amazonaws.mobile.client.AWSMobileClient.getHostedUIJSON(AWSMobileClient.java:655)
D/AWSMobileClient(18123): 	at com.amazonaws.mobile.client.AWSMobileClient._showSignIn(AWSMobileClient.java:2679)
D/AWSMobileClient(18123): 	at com.amazonaws.mobile.client.AWSMobileClient.showSignIn(AWSMobileClient.java:2659)
D/AWSMobileClient(18123): 	at com.pycampers.flutter_cognito_plugin.Cognito.showSignIn(Cognito.kt:236)
D/AWSMobileClient(18123): 	at java.lang.reflect.Method.invoke(Native Method)
D/AWSMobileClient(18123): 	at com.pycampers.plugin_scaffold.PluginScaffoldPluginKt$createPluginScaffold$1$$special$$inlined$let$lambda$1.invoke(PluginScaffoldPlugin.kt:78)
D/AWSMobileClient(18123): 	at com.pycampers.plugin_scaffold.PluginScaffoldPluginKt$createPluginScaffold$1$$special$$inlined$let$lambda$1.invoke(Unknown Source:0)
D/AWSMobileClient(18123): 	at com.pycampers.plugin_scaffold.PluginScaffoldPluginKt.catchErrors(PluginScaffoldPlugin.kt:172)
D/AWSMobileClient(18123): 	at com.pycampers.plugin_scaffold.PluginScaffoldPluginKt.catchErrors(PluginScaffoldPlugin.kt:179)
D/AWSMobileClient(18123): 	at com.pycampers.plugin_scaffold.PluginScaffoldPluginKt$createMethodWrapper$2$1.invoke(PluginScaffoldPlugin.kt:132)
D/AWSMobileClient(18123): 	at com.pycampers.plugin_scaffold.PluginScaffoldPluginKt$createMethodWrapper$2$1.invoke(Unknown Source:0)
D/AWSMobileClient(18123): 	at com.pycampers.plugin_scaffold.DoAsync.doInBackground(PluginScaffoldPlugin.kt:287)
D/AWSMobileClient(18123): 	at com.pycampers.plugin_scaffold.DoAsync.doInBackground(PluginScaffoldPlugin.kt:281)
D/AWSMobileClient(18123): 	at android.os.AsyncTask$3.call(AsyncTask.java:378)
D/AWSMobileClient(18123): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
D/AWSMobileClient(18123): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
D/AWSMobileClient(18123): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
D/AWSMobileClient(18123): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
D/AWSMobileClient(18123): 	at java.lang.Thread.run(Thread.java:919)

and then

E/flutter (18123): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(java.lang.Exception, showSignIn called with HostedUI options in awsconfiguration.json, java.lang.Exception: showSignIn called with HostedUI options in awsconfiguration.json
E/flutter (18123): 	at com.amazonaws.mobile.client.AWSMobileClient$23.run(AWSMobileClient.java:2684)
E/flutter (18123): 	at com.amazonaws.mobile.client.internal.InternalCallback$1.run(InternalCallback.java:101)
E/flutter (18123): 	at java.lang.Thread.run(Thread.java:919)
E/flutter (18123): )
E/flutter (18123): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter (18123): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:163:17)
E/flutter (18123): <asynchronous suspension>
E/flutter (18123): #2      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:337:12)
E/flutter (18123): #3      Cognito.invokeMethodWithChannel (package:flutter_cognito_plugin/flutter_cognito_plugin.dart:75:36)
E/flutter (18123): #4      Cognito.invokeMethod (package:flutter_cognito_plugin/flutter_cognito_plugin.dart:92:12)
E/flutter (18123): #5      Cognito.showSignIn (package:flutter_cognito_plugin/flutter_cognito_plugin.dart:294:11)

And, my awsconfig.json is as follows:

{
    "IdentityManager": {
        "Default": {}
    },
    "CognitoUserPool": {
        "Default": {
            "PoolId": "XX-XXXX-X_abcd1234",
            "AppClientId": "XXXXXXXX",
            "AppClientSecret": "XXXXXXXXX",
            "Region": "XX-XXXX-X"
        }
    },
  "Auth": {
    "Default": {
      "OAuth": {
        "WebDomain": "XXX.auth.ap-south-1.amazoncognito.com",
        "AppClientId": "XXXXXXXX",
        "SignInRedirectURI": "myapp://callback",
        "SignOutRedirectURI": "myapp://signout",
        "Scopes": ["email"]
      }
    }
  }
}

Am I doing something wrong?

error: package com.pycampers.flutter_cognito_plugin does not exist

Hi

I am trying to build your example app but when I did, confronted with the following error. What have I done wrong?

xxxxx\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java:17: error: package com.pycampers.flutter_cognito_plugin does not exist
com.pycampers.flutter_cognito_plugin.FlutterCognitoPlugin.registerWith(shimPluginRegistry.registrarFor("com.pycampers.flutter_cognito_plugin.FlutterCognitoPlugin"));
^
1 error

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileReleaseJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 36s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 37.4s
Gradle task assembleRelease failed with exit code 1

Error in retrieving the decryption key used to decrypt the data from the persistent store. Returning null for the requested dataKey = provider

I tryed generete my apk folowing Flutter Tutorial and now my app is broken.

I don't understood the error...

D/PluginScaffold( 7236): invoke { channel: com.pycampers.flutter_cognito_plugin, method: isSignedIn(), args: null }
E/AWSKeyValueStore( 7236): com.amazonaws.internal.keyvaluestore.KeyNotFoundException: Error occurred while accessing AndroidKeyStore to retrieve the key for keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
I/AWSKeyValueStore( 7236): Deleting the encryption key identified by the keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
E/AWSKeyValueStore( 7236): Error in retrieving the decryption key used to decrypt the data from the persistent store. Returning null for the requested dataKey = provider
E/AWSKeyValueStore( 7236): com.amazonaws.internal.keyvaluestore.KeyNotFoundException: Error occurred while accessing AndroidKeyStore to retrieve the key for keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
I/AWSKeyValueStore( 7236): Deleting the encryption key identified by the keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
E/AWSKeyValueStore( 7236): Error in retrieving the decryption key used to decrypt the data from the persistent store. Returning null for the requested dataKey = token
E/AWSKeyValueStore( 7236): com.amazonaws.internal.keyvaluestore.KeyNotFoundException: Error occurred while accessing AndroidKeyStore to retrieve the key for keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
I/AWSKeyValueStore( 7236): Deleting the encryption key identified by the keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
E/AWSKeyValueStore( 7236): Error in retrieving the decryption key used to decrypt the data from the persistent store. Returning null for the requested dataKey = cognitoIdentityId
E/AWSKeyValueStore( 7236): com.amazonaws.internal.keyvaluestore.KeyNotFoundException: Error occurred while accessing AndroidKeyStore to retrieve the key for keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
I/AWSKeyValueStore( 7236): Deleting the encryption key identified by the keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
E/AWSKeyValueStore( 7236): Error in retrieving the decryption key used to decrypt the data from the persistent store. Returning null for the requested dataKey = isFederationEnabled
D/AWSMobileClient( 7236): Inspecting user state details

pleas help-me

MissingPluginException on APK release

My app is running fine on --debug mode and as well as --release mode but when i am generating a apk of the project and trying to use the plugin functions I got this error:
MissingPluginException(No implementation found for method attachPolicy on channel com.scientifichackers.aws_iot)

Can anyone please let me about this, I am stuck on this from last 2 days and this is the only error needed to be resolved in my project

Facebook federated signin not working?

Currently using the latest flutter_cognito_plugin from git and flutter_facebook_login: 3.0.0 for the facebook login function. Here is my code.

 facebookLogin.logIn(['public_profile', 'email']).then((result) {
            print(result.accessToken.token);

// passing user access token into the token field
            Cognito.federatedSignIn("Facebook", result.accessToken.token)
                .then((res) {
              print(res);
              c.complete(res);
            });
          }).catchError((error) {
            c.completeError(error);
          });

Error that I am getting

[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(com.amazonaws.services.cognitoidentity.model.NotAuthorizedException, Invalid login token. Not a valid OpenId Connect identity token. (Service: AmazonCognitoIdentity; Status Code: 400; Error Code: NotAuthorizedException; Request ID: a6f64c73-244b-452c-a869-0d207582b254), com.amazonaws.services.cognitoidentity.model.NotAuthorizedException: Invalid login token. Not a valid OpenId Connect identity token. (Service: AmazonCognitoIdentity; Status Code: 400; Error Code: NotAuthorizedException; Request ID: a6f64c73-244b-452c-a869-0d207582b254)

Example app not use AndroidX

When running the app for my android. I got the flutter output:
[!] Your app isn't using AndroidX.
To avoid potential build failures, you can quickly migrate your app by following the steps on https://goo.gl/CP92wY.

Unable to verify secret hash for client *************

NotAuthorizedException: Unable to verify secret hash for client 6npouauc8jt1fioujvblmvpise (Service: AmazonCognitoIdentityProvider; Status Code: 400; Error Code: NotAuthorizedException; Request ID: f964a2df-abf4-4750-bb9d-a731f63d82ad)
I/flutter (16710): com.amazonaws.services.cognitoidentityprovider.model.NotAuthorizedException: Unable to verify secret hash for client 6npouauc8jt1fioujvblmvpise (Service: AmazonCognitoIdentityProvider; Status Code: 400; Error Code: NotAuthorizedException; Request ID: f964a2df-abf4-4750-bb9d-a731f63d82ad)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.