sap / gigya-flutter-plugin Goto Github PK
View Code? Open in Web Editor NEWPlugin for easily integrating SAP CDC functionality and flows into your Flutter app.
License: Apache License 2.0
Plugin for easily integrating SAP CDC functionality and flows into your Flutter app.
License: Apache License 2.0
Hey, I am having trouble with keeping the session.
After I log in with the SDK, I am not able to keep the session. If I kill the app and open it again, I am logged out, and I need to log in again.
I tried your example as well, and it seems like that I am doing quite close with what you are doing. Any behind the scene configuration that I need to do?
I added the URL Types as well.
Thanks!
The CHANGELOG.md
file lists the oldest version first, which is wrong.
The changelog should list the most recent version first, so that the newest changes are visible immediately, without having to scroll to the bottom.
When logging with Google, and having an Interruption because of Login identifier exists
, following the example app behavior, linking to site throws an unhandled exception even when it is inside a Try Catch block.
Stack trace points to the platform channel
The code after caching the initial exception after loging is:
if (e.getInterruption() == Interruption.conflictingAccounts) {
handleGigyaInterruption(e);
}
.....
Future<void> handleGigyaInterruption(GigyaResponse e) async {
try {
LinkAccountResolver resolver =
GigyaSdk.instance.resolverFactory.getResolver(e);
final ConflictingAccounts conflictingAccounts =
await resolver.getConflictingAccounts();
if (conflictingAccounts.loginProviders.contains('site')) {
_showLinkToSiteBottomSheet(
conflictingAccounts.loginID,
resolver,
);
} else {
_showLinkToSocialBottomSheet(SocialProvider.google, resolver);
}
} catch (e, s) {
print('--------------- Social Login Google INTERRUPTION ERROR: $e, $s');
print('STATUS ${e.statusCode}: ${e.statusReason}');
print('ERROR ${e.errorCode}: ${e.errorDetails} ${e.mapped}');
print('------------------------------------------');
}
}
The functions _showLinkToSiteBottomSheet
and _showLinkToSocialBottomSheet
are exactly the same than the example application's ones.
Hello, when logging in with google, it throws an error:
ERROR 401020: Login Failed Captcha Required {callId: 264bd1b9ba6a4b67805dd59d5931cb2a, errorCode: 401020, errorDetails: Login Failed Captcha Required, errorMessage: Login Failed Captcha Required, apiVersion: 2, statusCode: 401, statusReason: Unauthorized, time: 2021-06-10T10:05:28.931Z, errorFlags: captchaNeeded}
How should we implement that captcha?
When logging in with invalid username and password, the method GigyaError.fromPlatformException
returns const GigyaError()
. The interesting details of the exception are not passed through to the calling method.
Hi there!
We are using your awesome plugin in our app, and we encountered a problem with getting the exact error message.
We are using:
For example, on login error, we get the exact error message in the errorDetails
property:
But, if we get an error on register a new user, we get a Validation failed on the errorDetails
property:
We looked a bit in the source code of the plugin and we found that the error message is on a property called ValidationErrors
:
But this property is not included in the gigya_models.dart file:
We are not sure if it is intended to be this way, or if it is possible to retrieve the error in another way?
We tried to add to the models file an attribute like validationErrors = json['validationErrors']?.elementAt(0)['message']
, and it works on registration error, but gives some trouble on succesful login.
Just for some context, we used your code in the example folder on this repo:
void onLoginPress(user, password) async {
setState(() {
_inProgress = true;
});
GigyaSdk.instance.login(user, password).then((result) {
final response = Account.fromJson(result);
setState(() {
_inProgress = false;
_requestResult = 'Login success:\n\n ${response.uid}';
});
Get.offAll(GigyaLoginChecker());
}).catchError((error) {
setState(() {
_inProgress = false;
_requestResult = 'Register error\n\n${error.errorDetails}';
});
});
}
We will much appreciate your help :)
Several of the API methods return a Future<Map<String, dynamic>>
.
This can be improved for end-users by instead of returning a Map, we return a better return type.
An example of this is the login()
API, where we could return an Account
object instead.
This repository does not have teams assigned correctly , for more information please refer - https://wiki.wdf.sap.corp/wiki/display/ospodocs/Repository+Linter+Issues+Explanation
The extension types language feature is scheduled to ship in Dart 3.3, which is the next stable release for Q1 2024. This is currently available on the Flutter beta channel.
The Gigya SDK provides a web implementation as defined here
Add support to the gigya_flutter_plugin
using this API so that the plugin also works on the web.
Preferably this is done using Dart's JavaScript interop, which is the new way of implementing web specific functionality for plugins.
cname
argument to web platform interface, per #71send("accounts.getJWT")
)InterruptionResolverFactory
OtpService
WebAuthenticationService
package:web
instead of dart:html
for accessing the window and such
JSPromise
from dart:js_interopthisArg
arguments for callAsFunction()
invocations (otherwise we'll run into type errors)const
to empty list literals, const <Foo>[]
extension type
s
Response
interop layer for our use case. The new extension types have access to the representation type. Thus we can have the 'overridden' methods redeclared, using the supertype for implementation purposes.JSObject, JSFunction, JSPromise
once the interop API is further along) Primitive types are still allowed (int, double, null, bool, String) See https://github.com/dart-lang/sdk/blob/main/sdk/lib/js_interop/js_interop.dart// ignore_for_line
/ // ignore_for_file
(There are 4~ uses, but these are needed to keep API variable names)GigyaError()
web/static_interop/response.dart
dart format
on the web implementation sources (the formatter doesn't yet support extension types)dart:js_util
, package:js
, and dart:js
imports with dart:js_interop
and dart:js_interop_unsafe
, as the former is now unsupported in dart2wasmallowInterop(Function)
with Function.toJS
, as the latter is what the web compilers do for the Function
type@staticInterop
and @anonymous
annotations, these are not needed for extension typeskIsWasm
constant)is
checks for JS types. On the JS backends (dart2js, DDC, dart2wasm) these checks will always succeed due to an implementation detail. Instead we should use the new isA<T extends JSAny>()
function from dart:js_interop
. This new function is only available in Dart 3.4, so it will have to wait a little.dartify()
/ jsify()
interop API's
context
parameterdata
parameter for get/set accountInfocustomButtons
parameter (showScreenset)customLang
parameter (showScreenset)initSdk()
manually loads the Gigya script on-demand, which prevents uers from including the global config there. We should just tell users to add a <script>
tag in the <head>
of their index.html, which initializes window.__gigyaConf
. We could also add a Dart API to set the configuration, but in my opinion this is not worth the effort.Hello there! π
When app is build in release (minified R8) mode, I keep getting this exception:
Unhandled Exception: MissingPluginException(No implementation found for method isLoggedIn on channel com.sap.gigya_flutter_plugin/methods)
If I set minify to false, it is working as expected, but this is a "dirty" workaround since minification is a must for all android builds going live.
So, instead of disabling minification globally, a kinda better workaround I found is utilizing proguard to skip minification for only gigya sdk stuff like this:
-keep class com.gigya.** { *; }
Even though proguard is an optimal workaround, this seems like a library issue which needs fixing π€·ββοΈ
Version: 1.0.1
Platform: Android
Flutter version: 3.10.3
Cheers βοΈ
We are getting a generic 400 gigya error when using Google Login. It happens in random time intervals.
We are not able to reproduce locally, only when uploaded to the Play Store.
The current public API of the plugin, as viewed under the LIBRARIES
section on pub.dev is rather hard to understand.
I note the following:
Future<Map<String, dynamic>>
never document what exactly is in the returned Map.
showScreenSet()
returns dynamic, which does not make sense. Is it void/Future/something else?Map<String, dynamic>
as arguments to a function, the function never documents what should be in the Mapdynamic
for the type of a method parameterI am aware that the plugin is in its early stages, I just wanted to highlight some things I noticed.
I am not sure if pull requests are welcome, I would certainly help out with cleaning this up a little.
On Android devices, when back from Web Screen-Set with hardware back key, EventChannel('screensetEvents')
throws the following error (uncatchable) and the application crashes.
PlatformException(200001, Operation canceled, null, null)
The cause of this is the flutter side implementation of the plugin do not pass onError
to EventChannel('screensetEvents').receiveBroadcastStream().listen()
.
const EventChannel _stream = EventChannel('screensetEvents');
_screenSetsEventStream = _stream.receiveBroadcastStream().listen((onData) {
onScreenSetEvent(
onData['event'],
onData['data'],
);
if (onData['event'] == 'onHide' || onData['event'] == 'onCanceled') {
_screenSetsEventStream = null;
}
});
But, I think, Android's onCanceled
should be returned by success()
instead of error()
like onError
in the first place.
Not really good:
override fun onCanceled() {
screenSetsEventsSink?.error("200001", "Operation canceled", null)
screenSetsEventsHandler = null
screenSetEventsChannel = null
screenSetsEventsSink = null
}
LGTM:
override fun onCanceled() {
screenSetsEventsSink?.success(
mapOf(
"event" to "onCanceled",
"data" to mapOf<String, Any>()
)
)
screenSetsEventsHandler = null
screenSetEventsChannel = null
screenSetsEventsSink = null
}
Thank you.
The readme indicates the minimum Android version that is supported.
However, for iOS this is not the case.
Since we recently bumped the iOS version to iOS 13 (to make specific code paths easier, since they no longer require #available checks), we should mention iOS 13.0
as the minimum version.
Also, there is a typo for the iOS AppDelegate setup, which mentions "Android" instead of "iOS", see https://github.com/SAP/gigya-flutter-plugin/blob/main/README.md#ios-setup
Hi devs,
using your sdk we are able to show screensets in a standalone webview.
How is it possible to open the screenset in a inAppWebview or in another container to avoid to see an other view on top of our main view?
HI,
I'm facing an error when I try to use an apk built in release mode.
Unhandled Exception: MissingPluginException(No implementation found for method showScreenSet on channel gigya_flutter_plugin)
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154)
#1 GigyaSdk.showScreenSet (package:gigya_flutter_plugin/gigya_flutter_plugin.dart:298)
Can you help us?
Thanks
Hi @tal-mi
I noticed that after I log in with an active user in the gigya-flutter-plugin app, the active login session is not retained if I close the app and reopen it again.
Could you please help me if there is any parameter set to retain the login session even after I close the app and reopen.
Regards
Suresh
Hi, we have required fields in our user schema, and so when users use social login, some fields are missing.
If I'm not wrong, we should call finalizeRegistration with the missing data:
Pointed in gigya's docs:
Account pending registration (error code 206001) - returned when you call a method that performs social login, such as this method, and the registration process has not been finalized, or the schema defines fields as required and one or more of these fields are missing from the user Profile or custom data fields. The expected next step is: if the schema defines fields that are required and one or more of these fields are missing from the user profile or data, call accounts.setAccountInfo. If the registration process has not been finalized, call accounts.finalizeRegistration with the regToken.
How should we handle this situation with Flutter SDK? We tried to use setAccount
to set missing fields, but we can't call setAccount
if the user is not logged in. (and he can't log in if his registration process has not finished)
UPDATE:
I've advanced in the flux, which is similar to conflictingAccounts.
Now I need to update the account using the resolver:
resolver.setAccount({
"profile": json.encode({
"birthMonth": '5',
"birthYear": '5',
}),
});
I'm just getting this error:
E/flutter (22965): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: type 'ArgumentError' is not a subtype of type 'PlatformException'
E/flutter (22965): #0 PendingRegistrationResolver.setAccount.<anonymous closure> (package:gigya_flutter_plugin/interruption/interruption_resolver.dart:72:48)
E/flutter (22965): #1 _rootRunUnary (dart:async/zone.dart:1362:47)
E/flutter (22965): #2 _CustomZone.runUnary (dart:async/zone.dart:1265:19)
E/flutter (22965): #3 _FutureListener.handleError (dart:async/future_impl.dart:172:20)
E/flutter (22965): #4 Future._propagateToListeners.handleError (dart:async/future_impl.dart:719:47)
E/flutter (22965): #5 Future._propagateToListeners (dart:async/future_impl.dart:740:24)
E/flutter (22965): #6 Future._completeError (dart:async/future_impl.dart:550:5)
E/flutter (22965): #7 _completeOnAsyncError (dart:async-patch/async_patch.dart:274:13)
E/flutter (22965): #8 MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart)
E/flutter (22965): <asynchronous suspension>
First, could you documentate how to use that method?
Second, there is an error trying to parse an exception as you can see above.
Looking at this link https://help.sap.com/viewer/8b8d6fffe113457094a17701f63e3d6a/GIGYA/en-US/4137589670b21014bbc5a10ce4041860.html, in JS sdk there are some parameters to add on Logout, in particular a we can add a callback to check the response. How can I check error case?
How can we do this on flutter?
When using this to show a screenset:
GigyaSdk.instance.showScreenSet(screenSet, (event, map) {
debugPrint('Screen set event received: $event');
debugPrint('Screen set event data received: $map');
if (event == 'onHide' || event == 'onLogin') {
setState(() {});
}
});
How can I close the screenset shown if there is an error event coming through?
Hello there!
It seems that configuring the sdk with json or cname is not possible in 1.0.1 π€
Would it be possible to add cname
argument in sdk init method, since android and ios support it and currently just don't use it, or generally to support initialization of the sdk using a json file π€·ββοΈ
Thanks! βοΈ
Currently the Swift wrapper classes for Facebook & GoogleSignIn are out of date, which breaks the example app on iOS.
You can run the example if you comment out the Swift wrappers, but that is not ideal for a fully featured example app.
google_sign_in
& facebook_auth
dependencies (the versions are a bit out of date)SessionInfo.expirationTime access on android crashing, since parsing logic is not handled for android
Removing the Platform.isIOS check will solve the issue
from the plugin:
/// Init SDK using apiKey and apiDomain
Future<Map<String, dynamic>?> initSdk(String apiKey, String apiDomain,
[bool forceLogout = true]) async {
if (forceLogout) {
await logout();
}
sometimes, when there's some issue with the method logout:
await _channel.invokeMethod(Methods.logOut.name).catchError((error) {
debugPrint('Error logging out');
}).timeout(getTimeout(Methods.logOut), onTimeout: () {
debugPrint('A timeout that was defined in the request is reached');
return timeoutError();
});
the message "Error logging out" is shown on the console, and the login page inside the plugin is blank, no actions can be taken. Any way to handle the error and ignore the force logout?
Hi, we have setup google social login. When we launch google's social login, the native google login screen is launched, but after selecting a google account and coming back to our application, we receive a 400 error with no errorReason, so we cannot find out what's failing.
We have followed all the instructions in Gigya's core SDK to enable Google sign-in.
try {
var result =
await GigyaSdk.instance.socialLogin(SocialProvider.google);
print('--------------- Social Login Google OK');
print('--------------- $result');
} on GigyaResponse catch (e) {
print('--------------- Social Login Google ERROR');
print('STATUS ${e.statusCode}: ${e.statusReason}');
print(
'ERROR ${e.errorCode}: ${e.errorDetails} callId: ${e.callId}');
print('INTERRUPTION ${e.getInterruption()}');
print('------------------------------------------');
I/flutter ( 2970): --------------- Social Login Google ERROR
I/flutter ( 2970): STATUS 0: null
I/flutter ( 2970): ERROR 400: null callId:
I/flutter ( 2970): INTERRUPTION null
I/flutter ( 2970): ------------------------------------------
Doctor summary (to see all details, run flutter doctor -v):
[β] Flutter (Channel stable, 2.2.0, on Microsoft Windows [VersiΓΒ³n 10.0.19042.985], locale es-ES)
[β] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[β] Chrome - develop for the web
[β] Visual Studio - develop for Windows (Visual Studio Community 2019 16.8.5)
[!] Android Studio (not installed)
[β] VS Code (version 1.56.2)
[β] Connected device (4 available)
gigya_flutter_plugin:
dependency: "direct main"
description:
name: gigya_flutter_plugin
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.6"
I'm getting the following error when following these steps:
var res = await resolver.linkToSocial(SocialProvider.apple);
NoSuchMethodError: The method '[]' was called on null.
Receiver: null
Tried calling: []("callId"), #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:63:5)
#1 new GigyaResponse.fromJson (package:gigya_flutter_plugin/models/gigya_models.dart:35:22)
#2 new Account.fromJson (package:gigya_flutter_plugin/models/gigya_models.dart:82:42)
#3 _showLinkToSiteBottomSheet.<anonymous closure> (package:reactions/components/SocialButtons.dart:344:61)
<asynchronous suspension>
These steps works corretly for other linkings, for example Facebook -> Google, Google -> Facebook, etc
The executing code is (inside a try catch):
var res = await resolver.linkToSocial(SocialProvider.apple);
final Account account = Account.fromJson(res);
It looks like linkToSocial don't throw any error, but it returns null. The apple webview never opens.
Hi. I am using the latest version(1.0.0) of this plugin and when I use GetIt.I().send() function, whenever an error occurs, the GigyaError object seems to be having all null values when debugging from Flutter side. But when debugging the native code, I can see that the error is returned with data. There seems to be some data loss when sending the data from iOS/Android to Flutter.
gigya_flutter_plugin - 1.0.0
iPhone SE 3rd Gen Simulator - iOS 16.2
Pixel 4 (API 29)
Are you going to review my MR?
#8
When a user links a social media account to an existing account from the showScreensets
view, the plugin behaves differently on Android and iOS.
On Android, after a successful linking, the user is automatically logged in and an onLogin
event is emitted.
On iOS, after a successful linking, the user is not automatically logged in (can be verified with the isLoggedIn
function), and the screen sets automatically close. The user then needs to login again.
The preferred behaviour would be for both Android and iOS to automatically log in the user after linking their accounts.
We are using the plugin to show screenset on our app. Using iOS We can see the webpage almost correct. Using Android, in the webview there is a white border and the page is not fullscreen. Looking at the Android Sdk, in the method showScreenset there is a parameter fullScreen to use but in your sdk this parameter is not present. Could be this parameter the problem? Can you help me? Please
Hi!
We are using this plugin in our app and so far implemented login, register and social register, but we encountered a problem with the forgot password function. The problem occurs on IOS and Android.
We are using:
gigya-flutter-plugin - 0.1.1
Swift SDK (on IOS)
We get to the point where the source code enters the forgot password
function and we can see that it receives successfully the email (loginId) :
But it won't return the result, it just exits the app with the following error:
Sometimes inside the parenthesis, there is a long id
or a 200
status code, but it never reaches the line of returning the result (and therefore never enters our then
or catch
block).
To clarify, we DO get the email for resetting the password and this part works well!
Our implementation of the forgot password function is taken from your example code
void sendRequest(
String email,
) async {
if (!_formKey.currentState.validate()) {
return;
}
setState(() {
_inProgress = true;
});
GigyaSdk.instance.forgotPassword(email).then((result) {
setState(() {
_inProgress = false;
_requestResult = 'Forgot password success';
showError = false;
finished = true;
});
Get.back();
}).catchError((err) {
debugPrint('error $err');
setState(() {
_inProgress = false;
_requestResult = '${err?.errorDetails}';
showError = true;
});
});
}
Thank you, we will much appreciate your help :)
I'm getting this error when creating a release APK:
E/AndroidRuntime(13063): java.lang.RuntimeException: Unable to start activity ComponentInfo{es.sonypictures.reactions/es.sonypictures.reactions.MainActivity}: java.lang.RuntimeException: Error creating Gigya SDK (did you forget to Gigya.setApplication or missing apiKey?)
E/AndroidRuntime(13063): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3322)
E/AndroidRuntime(13063): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3471)
E/AndroidRuntime(13063): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
E/AndroidRuntime(13063): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(13063): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(13063): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2058)
E/AndroidRuntime(13063): at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(13063): at android.os.Looper.loop(Looper.java:226)
E/AndroidRuntime(13063): at android.app.ActivityThread.main(ActivityThread.java:7592)
E/AndroidRuntime(13063): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(13063): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
E/AndroidRuntime(13063): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
I've tried configuring Gigya's ApiKey using the two methods available:
https://sap.github.io/gigya-android-sdk/sdk-core/
I've configured the Gigya SDK following the instructions, and it works when running in debug mode.
I currently have dart format
set to formatting to 120 characters per line, globally in my Visual Studio Code user settings.
However, the default formatting for Dart projects is 80 characters per line.
We should enforce the line length for the project's Dart files.
In Visual Studio Code, adding this setting to the .vscode
folder/settings file should do it.
Not sure about other editors though.
Hello,
using version 1.0.1 with screen-sets I correctly receive sessionInfo
as the event.data
of onLogin
on Android, but not on iOS.
I just upgraded from 0.1.7 where it was working on both platforms.
showScreenSet
parameters include
"include": "profile, data, id-token, preferences, subscriptions, groups"
On iOS sessionInfo is missing.
Thanks
JCenter has been deprecated and should be removed from build.gradle
.
https://blog.gradle.org/jcenter-shutdown
If I remove jcenter()
from the build.gradle file, I get a Kotlin not supported
warning in Android Studio.
Consider putting the remaining dependencies onto Maven or somewhere else.
Hey all, when calling:
final response = await GigyaSdk.instance.login();
final account = Account.fromJson(response);
I'm seeing the sessionInfo property as null. When I inspect the network response - I see this sessionInfo in the response, but it seems to not de-serialize succesfully.
When SAP/gigya-swift-sdk#59 is addressed, we should add support for this here as well.
We can just pass through the required arguments to make it work.
In the web SDK API docs it is stated that the statusCode
and statusReason
fields are deprecated.
Mark statusCode
& statusReason
as deprecated in the Gigya response models and stop filling these fields when building responses.
When using Gradle 7 for the build, and error is thrown:
FAILURE: Build failed with an exception.
* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
The following dependencies do not satisfy the required version:
project ':gigya_flutter_plugin' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50
A kotlin garde plugin upgrade would be required for the next releases.
Configuration on CDC done.
Using the example app provided with the flutter SDK, the apple login is not working.
A popup screen appears and mentions "failed connecting. Please try again later."
Here is the code relevant to the GigyaSDK setup:
case SocialAuthenticationType.apple:
{
GigyaSdk.instance
.socialLogin(SocialProvider.apple)
.then((result) {
print(result);
});
}
Hi there,
I hope someone can please help with this as I do not seem able to figure out on my own.
Here is our gigyaSdkConfiguration.json:
{ "apiKey": "secret", "apiDomain": "eu1.gigya.com", "accountCacheTime": 60, "account": { "cacheTime": 1, "include": [ "data", "profile", "emails" ], "extraProfileFields": [ "locale", "phones" ] }, "sessionVerificationInterval": 0 }
We are moving from a single step registration to a three steps one.
What we currently have is this:
await _gigya.register(options.email, options.password, params: { "profile": ..., "data": ...data, "preferences": ...preferences, "subscriptions": ...subscriptions, "finalizeRegistration": true, });
moving on to:
final Map<String, dynamic>? initRegistrationResponse = await _gigya.send("accounts.initRegistration",{}); await _gigya.register(options.email, options.password, params: { "profile": ..., "data": ...data, "preferences": ...preferences, "subscriptions": ...subscriptions, "finalizeRegistration": false, "regToken": initRegistrationResponse?['regToken'].toString(), });
which works correctly on iOs, as it returns something like:
{ "errorCode": 206001, "errorMessage": "Account Pending Registration", "statusCode": 206, "statusReason": "Partial Content"}
For some reason the same flow in Android will return a success such as:
{ errorCode: 0, apiVersion: 2, statusCode: 200, statusReason: OK, isActive: true, isRegistered: true, isVerified: false }
the expected response should be the same as the one from iOs, so as to be able to then call accounts.finalizeRegistration
and effectively change the value of "isRegistered" to true.
Any idea why this is happening?
The sdk is correctly configured, I am currently using ^0.2.1, but have also tested several previous ones, and we have been using a dozen other endpoints for months without a single issue.
Hello, I am wondering whether you will implement Login with Kakao support anytime soon. Are there any plans in the pipeline for this?
Thanks!
I've created a fork and added the following parameters to the login request:
GigyaSdk.instance.login(loginId, password, params: {
'include': 'id_token',
})
And added the idToken
property to the GigyaBaseResponse:
class GigyaResponse {
String callId;
int statusCode = 200;
int errorCode = 0;
String errorDetails;
String statusReason;
int apiVersion;
String regToken;
String idToken;
dynamic mapped;
GigyaResponse.fromJson(dynamic json)
: callId = json['callId'],
statusCode = json['statusCode'],
errorCode = json['errorCode'],
errorDetails = json['errorDetails'],
statusReason = json['statusReason'],
apiVersion = json['apiVersion'],
regToken = json['regToken'],
idToken = json['id_token'],
mapped = json;
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = {};
data['callID'] = callId;
data['statusCode'] = statusCode;
data['errorCode'] = errorCode;
data['errorDetails'] = errorDetails;
data['statusReason'] = statusReason;
data['apiVersion'] = apiVersion;
data['regToken'] = regToken;
data['idToken'] = idToken;
data['mapped'] = mapped;
return data;
}
}
This is the resulting request:
curl -H 'Host: accounts.us1.gigya.com' -H 'User-Agent: gigya_flutter_plugin_example/0.0.1 CFNetwork/1220.1 Darwin/20.3.0' -H 'Accept: */*' -H 'Accept-Language: en-us' -H 'Cache-Control: no-cache' --data "apikey=key&format=json&gmid=PudcthEJK05kuv6OQlCQlBiZgngoKO19I0fg0G2iWb0%3D&httpStatusCodes=false&include=id%5Ftoken&loginID=rob%2Eg%2B50%40test%2Ecom&password=Thanks%211&sdk=flutter%5F0%2E0%2E2%5Fios%5Fswift%5F1%2E2%2E0&targetEnv=mobile&ucid=U%2BB0tfmrvDUTfLVgdXt4uQ%3D%3D" --compressed 'https://accounts.us1.gigya.com/accounts.login'
And response:
{
"callId": "98cfb8da6c14463788d9a38a633aa492",
"errorCode": 0,
"apiVersion": 2,
"statusCode": 200,
"statusReason": "OK",
"time": "2021-04-29T18:22:24.217Z",
"registeredTimestamp": 1616620187,
"UID": "f47731bedd834272b410ee280165db4c",
"UIDSignature": "yASDFK7zuBeCuPTQwQSudtVuw2c=",
"signatureTimestamp": "1619720544",
"created": "2021-03-24T21:09:47.242Z",
"createdTimestamp": 1616620187,
"isActive": true,
"isRegistered": true,
"isVerified": false,
"lastLogin": "2021-04-29T18:22:24.159Z",
"lastLoginTimestamp": 1619720544,
"lastUpdated": "2021-03-24T21:09:47.341Z",
"lastUpdatedTimestamp": 1616620187341,
"loginProvider": "site",
"oldestDataUpdated": "2021-03-24T21:09:47.242Z",
"oldestDataUpdatedTimestamp": 1616620187242,
"registered": "2021-03-24T21:09:47.341Z",
"socialProviders": "site",
"newUser": false,
"id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlJFUTBNVVE1TjBOQ1JUSkVNemszTTBVMVJrTkRRMFUwUTBNMVJFRkJSamhETWpkRU5VRkJRZyIsImRjIjoidXMxIn0.eyJpc3MiOiJodHRwczovL2ZpZG0uZ2lneWEuY29tL2p3dC8zXzhydUE0TFc5UjY4bFdURWxid25fbk94TlIzVFlBdGZFaHZtNFhMRlR1QUlZcl95UHVUYnFuWHRmOWFxNGRCLUYvIiwic3ViIjoiZjQ3NzMxYmVkZDgzNDI3MmI0MTBlZTI4MDE2NWRiNGMiLCJpYXQiOjE2MTk3MjA1NDQsImV4cCI6MTYxOTcyMDYwNCwiaXNMb2dnZWRJbiI6dHJ1ZX0.iGA13Nwy2WwolpGjpodsnZuDg9DaGHkF3OhRzcaRnvvuDM5BWg2O8pkiRqjtRAzqTbfkaW2G9dd-5vl3HYFU86Trj4ZxWQgpDMpVVjVBOAsAbheSy3GEifPc8v1Rk6swq6MM3uga9nz-n4qI6X7t0fd-GAJ3PYaPayk5n6Q4LqW6DJ6CjhFg2B5gzf2zE8s22ojaqW_h2g3OMahNBf5erOeVqblXe54_zJpz8CBiqvEWd5d00CExOlge1NVZgx4Vp07Ns3ngwiJsar_jR8XbES-olEwbFEr85v66rrRE8Lsis2FMZMma39h6tBtMFAOBpkuqv43CuWXi4hGaiNbwOQ",
"sessionInfo": {
"sessionToken": "st2.s.AcbHNHMzAg.hQQZrMBDaTcmDHt_ICm6ya1vOAEZt7W7glhG09_AgdMmAsYdEVBMS5a0ge2l2hv-ARTihTRsu7z_m9nblRQjmQMNGPZd3EI0HQjK-9a47O8.bEeyTDhp9kVw_emYQ753Ejxs2Z9-yrYidZ7T1UK9-KMG3nqed0IwOZuKvWDmNkCawEFo7FPnmZa71Bu6sXF52Q.sc3",
"sessionSecret": "oUt9hiXi9bK4V0/6JlbrxVSelXc=",
"expires_in": "0"
}
}
But the property is still null:
GigyaSdk.instance.login(loginId, password, params: {
'include': 'id_token',
}).then((result) {
debugPrint(json.encode(result));
final response = Account.fromJson(result);
print('token: ${response.idToken}'); // token: null
})
I am facing an issue while doing gigya social login. It happens when we run the App in split mode in fireTab/AndroidTab. We are using android sdk "gigya-android-sdk-4.0.6"
Login works fine when we run the app in single mode(No Split screen)
Error logs
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.scripps.android.foodnetwork, PID: 14777
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gigya.android.sdk.ui.WebLoginActivity}: java.lang.NullPointerException: uriString
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2934)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3075)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1824)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:211)
at android.app.ActivityThread.main(ActivityThread.java:6740)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.NullPointerException: uriString
at android.net.Uri$StringUri.(Uri.java:490)
at android.net.Uri$StringUri.(Uri.java:480)
at android.net.Uri.parse(Uri.java:452)
at com.gigya.android.sdk.ui.WebLoginActivity.onCreate(WebLoginActivity.java:72)
at android.app.Activity.performCreate(Activity.java:7161)
at android.app.Activity.performCreate(Activity.java:7151)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
Hello,
On Android, when I want to run my application in debug mode, I have an error to retrieve sdk-core dependency for gigya-android-sdk.
Could not find com.github.SAP.gigya-android-sdk:sdk-core:core-v6.2.1.
When I go to https://jitpack.io/com/github/SAP/gigya-android-sdk/sdk-core/core-v6.2.1/sdk-core-core-v6.2.1.pom to see the dep. I have the following error :
Build failed. See the log at jitpack.io
On release mode, I have this issue :
Failed to transform sdk-core-core-v6.2.1.aar (com.github.SAP.gigya-android-sdk:sdk-core:core-v6.2.1) to match attributes {artifactType=android-aar-metadata, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not find sdk-core-core-v6.2.1.aar (com.github.SAP.gigya-android-sdk:sdk-core:core-v6.2.1).
Searched in the following locations:
https://jitpack.io/com/github/SAP/gigya-android-sdk/sdk-core/core-v6.2.1/sdk-core-core-v6.2.1.aar
Thank you in advance for your support.
Hello Everyone.
We are currently using this plugin to help us communicate with the Gigya plugin to Auth using email/password and a few social media providers. We are using showScreenSet to show the Auth page. In the below explanation, I was trying to Sign In via Apple.
I created an account using email and password first. Then I tried to sign in via Apple where the AppleID is the same email as the one used to create an account using email and password. Once the AppleID auth and 2FA is done, we are taken to an Account Linking page where I need to enter the password I used when creating the account with email and password.
On iOS, after we enter the password in the Account Linking page, we get a 200009 response as an onError event which says that the accounts are linked and we can easily proceed with the auth flow of the app.
However, on Android, we just get an onHide event after we enter the password in the Account Linking page. At this time, GigyaSdk.instance.isLoggedIn returns us false and if we try to call GigyaSdk.instance.send('accounts.verifyLogin', {},) it just throws an error which is expected. A workaround is to add a delay until GigyaSdk.instance.isLoggedIn returns true, but this does not work as required if the internet connection is not fast enough.
Any help would be appreciated.
The Security.md file does not exists, please create a security file in the root path of your repository for more information please refer - https://wiki.wdf.sap.corp/wiki/display/ospodocs/Repository+Linter+Issues+Explanation
I have implemented the following code:
GigyaSdk.instance.showScreenSet(screenSet, (event, map) async {
if (event == 'onHide' || event == 'onLogin') {
setState(() {});
}
}, parameters: {
"startScreen": 'MobileLogin', <--- (Default is 'gigya-login-screen')
"deviceType": 'mobile',
"mobileScreenSet": screenSet,
});
On Android it shows the correct startScreen, but on iOS it doesn't take the startScreen parameter into account.
iOS Log:
Data - {data: {profile: {}, data: {}, preferences: {}, eventName: beforeScreenLoad, sourceContainerID: pluginContainer, source: showScreenSet, response: {}, instanceID: pluginContainer, subscriptions: {}, nextScreen: gigya-login-screen}, event: onBeforeScreenLoad}
As you can see the nextScreen: gigya-login-screen
is wrong, doesn't show the correct screen there.
Android Log:
Data - {data: {profile: {}, data: {}, preferences: {}, eventName: beforeScreenLoad, sourceContainerID: pluginContainer, source: showScreenSet, response: {}, instanceID: pluginContainer, subscriptions: {}, nextScreen: MobileLogin}, event: onBeforeScreenLoad}
This is the correct screen nextScreen: MobileLogin
.
I am trying to implement Gigya signup using credentials and forgetPassword in Flutter. I are getting this 400106 Not connected User is not connected to the required network or to any network. error code and description when I am trying to call gigya.register(..) via gigya_flutter_plugin ^0.1.6 version. How to resolve this error.
Also I am not able to initialize gigya using 1.0.0 version. I have followed step by step guide given on https://github.com/SAP/gigya-flutter-plugin. Any implemented working code in flutter using 1.0.0 will also be helpful.
Also using example app provided on flutter plugin repo is also giving null error on Signup using credential. Sending this parameter.
Map<String,dynamic>();
profile["${FIRST_NAME_KEY}"] = 'Harsh';
profile["${COUNTRY_KEY}"] = COUNTRY_VALUE;
final temp = Map<String,dynamic>();
temp["${NUMBER_KEY}"] = '9********0';
profile["${PHONE_KEY}"] = temp;
param["${PROFILE_KEY}"] = profile;
final finalparam = HashMap<String,dynamic>();
finalparam["${PROFILE_KEY}"] = profile;
response = await gigya.register(
'hars*******@gmail.com',
'Password@1234', params: finalparam);
Hi,
We are using your plugin in a project and, when we tried to extract the error message on Android, we had a problem.
In MainActivity.kt, for implementation we added:
val plugin: GigyaFlutterPlugin = flutterEngine.plugins.get(GigyaFlutterPlugin::class.java) as GigyaFlutterPlugin
plugin.registerWith(application, GigyaAccount::class.java, flutterEngine.dartExecutor.binaryMessenger)
And in AndroidManifest.xml file we have this:
<meta-data
android:name="apiKey"
android:value="3_-MkajnAgr6HgZsps35bl_aYNMG338riz8FjDzDiBMRhzYw3wswmZQwyuzOubo2z4" />
<meta-data
android:name="apiDomain"
android:value="us1.gigya.com" />
<meta-data
android:name="accountCacheTime"
android:value="1" />
<meta-data
android:name="sessionVerificationInterval"
android:value="60" />
The problem is that the error message has all values null
We also have tried the solution in the other open issue, but the mapped is also null. On IOS everything works fine, including the mapped object.
Do you have any solution or any idea why this is happening?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.