I have been attempting to implement an Okta login solution in my Backendless Flutter web application, and believe I have found an issue with the web-implementation of the “setCurrentUser” function.
I have every step of the “login without provider” strategy implemented, from redirecting to the Okta login interface, having a successful Okta response redirect to Backendless, and ultimately Backendless redirecting back to my application with a fresh user ID and token.
I am then able to successfully call:
Backendless.userService.setUserToken(token);
``
But when I attempt to call
Backendless.userService.setCurrentUser(user, stayLoggedIn: true);
with either “true” or “false” for “stayLoggedIn”, I always receive the following error:
PlatformException(error, NoSuchMethodError: 'call'
Dynamic call of object has no instance method 'call'.
Receiver: Instance of 'LinkedMap<Object?, Object?>'
Arguments: ["stayLoggedIn"], null, null)
I have verified that the input “user” is properly formatted and even added the “user-token” property in case that was the issue, and it did not fix anything. It seems like the Flutter web implementation of “setCurrentUser” is malformed. I was able to send the same token and userId response to my cloud code where I could successfully “log in” and create a usable user context.
Could someone please either confirm this issue or indicate to me whether there’s an alternative method/strategy that I could use to create a successfully logged-in context within my Flutter application after a successful Okta login?