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

unhandled exception on await client.LoginAsync(); #question #9

Closed
ghost opened this issue Mar 13, 2017 · 6 comments
Closed

unhandled exception on await client.LoginAsync(); #question #9

ghost opened this issue Mar 13, 2017 · 6 comments
Labels

Comments

@ghost
Copy link

ghost commented Mar 13, 2017

Im getting an unhandled exception on await client.LoginAsync();

i used the sample of andoird Web View of https://github.com/IdentityModel/IdentityModel.OidcClient.Samples

pass a copy of my IBrowser implemented Class

public class SystemBrowser : IBrowser
    {
private readonly Context _context;

        //public event EventHandler<Browser> HiddenModeFailed;

        public SystemBrowser(Context context)
        {
            _context = context;
        }

        public Task<BrowserResult> InvokeAsync(BrowserOptions options)
        {
            
            var tcs = new TaskCompletionSource<BrowserResult>();

            var intent = new Intent(_context, typeof(AuthWebViewActivity));
            intent.PutExtra("ClearCookies", true);
            var state = new AuthWebViewActivity.State
            {
                Options = options
            };

            state.OnSuccess += (onj, res) =>
            {

                tcs.SetResult(new BrowserResult
                {
                    Response = res,
                    ResultType = BrowserResultType.Success
                });
            };
            intent.PutExtra("StateKey", AuthWebViewActivity.StateRepo.Add(state));

            _context.StartActivity(intent);

            return tcs.Task;
        }
@ghost ghost changed the title unhandled exception on await client.LoginAsync(); unhandled exception on await client.LoginAsync(); #question Mar 13, 2017
@leastprivilege
Copy link
Contributor

Well - if that is all the info you have, you need to debug it.

@ghost
Copy link
Author

ghost commented Mar 13, 2017

Can´t do more debug, stacktrace says an external library caused the exception

@ghost
Copy link
Author

ghost commented Mar 13, 2017

Callstack:
[External Code]

The las thing that debugger hits is
` state.OnSuccess += (onj, res) =>
{

                tcs.SetResult(new BrowserResult
                {
                    Response = res,
                    ResultType = BrowserResultType.Success
                });
            };`

hits the SetResult and then raise the exception.

I reach the Url and enter the credentials, May be i didnt get right the Sample be cause in the example doesnt got IBrowser interface. Do you have any docs of this?

@leastprivilege
Copy link
Contributor

Sorry - don't know anything about Android - I am pretty sure your IDE must have an option to see the real exception.

@ghost
Copy link
Author

ghost commented Mar 14, 2017

I think maybe is the targeted api, i use the CustomTabsSample as base for my app and updated the IdentityModel.OidcClient to v2.0 (The sample has 1.0) and works!. Also i have some problems with other libraries like Xamarin.Auth with nougat api, so i think that´s the problem, Closing the issue, thanks for the reply @leastprivilege !

@ghost ghost closed this as completed Mar 14, 2017
@github-actions
Copy link

github-actions bot commented Jun 2, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 2, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

1 participant