Flutter Web Oauth2 Login Issues

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?

Hello, @Zach_Robinson.

We will investigate your problem in the near future.

Regards, Nikita.

What is the timeline looking like for this being investigated?

Thanks!

Do I correctly understand that this problems appears only for web?

I have only experienced this issue with the Flutter web build.

I have not tested the same process with either the iOS or Android Flutter builds.

Hi @Zach_Robinson ,

Thank you for your patience. We will look into the issue as soon as possible. Unfortunately, I cannot provide an exact timeline for resolution at this moment. We will update you on the progress.

Regards,
Viktor

Good morning Backendless Team,

Any update on this? We have a production application that this functionality is now required for and are in a holding pattern until we are able to find a resolution.

Thanks,

Matt Olson, Boundless Design

Hello, @Matt_Olson, @Zach_Robinson.

This fix has already been released in 7.3.8 version of backendless_sdk for flutter.
Let me know if you still have any problems.

Regards, Nikita.

Thank you, Nikita! I’ll be testing with it this evening and will update.

1 Like