Skip to content
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

There is no return object for signIn() method #4

Open
J-DK opened this issue Apr 1, 2021 · 5 comments
Open

There is no return object for signIn() method #4

J-DK opened this issue Apr 1, 2021 · 5 comments

Comments

@J-DK
Copy link

J-DK commented Apr 1, 2021

Hi, As per the documentation, the method below returns the object which has the parameter of type resolve_type .

await oktaSdk.signIn();

When I tried to use it, it was not returning anything. Can you please help on this? Or let me know if I should ask this question to the author?

@sonikro
Copy link
Collaborator

sonikro commented Apr 3, 2021

Hello @J-DK , I think the problem is at the library. We are not returning the results of the signIn() method:

https://github.com/sonikro/flutter-okta-sdk/blob/cfb2a80756ac0c236cab98e8b08be820b99cdc4a/lib/flutter_okta_sdk.dart#L22

This is how it is today

Future<void> signIn() async {
    if (this.isInitialized == false) {
      throw Exception("Cannot sign in before initializing Okta SDK");
    }
    await _channel.invokeMethod('signIn');
  }

And it should be like this:

Future<void> signIn() async {
    if (this.isInitialized == false) {
      throw Exception("Cannot sign in before initializing Okta SDK");
    }
   return await _channel.invokeMethod('signIn');
  }

Going through the native code, I think the native class is returning the result, but the Dart class is not. I'll open a Issue for this, and hopefully release a fix soon

@sonikro
Copy link
Collaborator

sonikro commented Apr 3, 2021

@J-DK , this was published at version 1.0.0-dev.5. Could you please update, and see if its working for you ?

@J-DK
Copy link
Author

J-DK commented Apr 5, 2021

Sure @sonikro. I will check and update you.

@J-DK
Copy link
Author

J-DK commented Apr 5, 2021

Hi @sonikro, I updated the package and now it's returning an object with the parameter resolve_type.

However, when I use the authorise() method, it takes me to the okta sign in page and when I tried to sign in by providing the valid credentials, it failed with this error {error_code: Okta Oidc error, error_message: Authorization error}.

I confirmed that it was returning an object with the parameter resolve_type when I closed the sign in page (the resolve_type value was cancelled) after it was redirected.

@Sachin1000
Copy link

Hi, Can we get SignIn URL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants