question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Never goes back to the app

See original GitHub issue

The codes works well. My issue is, it never goes back to the app after logging in.

[Activity(NoHistory = true, LaunchMode = LaunchMode.SingleTop)]
[IntentFilter(new[] { Android.Content.Intent.ActionView },
	Categories = new[] { Android.Content.Intent.CategoryDefault, Android.Content.Intent.CategoryBrowsable },
	DataScheme = Constants.DataScheme,
	DataHost = Constants.DataHost
	)]
public class WebAuthenticationCallbackActivity : Xamarin.Essentials.WebAuthenticatorCallbackActivity
{
	public WebAuthenticationCallbackActivity()
	{

	}
}
public static class Constants
{
	public const string DataScheme = "oauth2test";
	public const string DataHost = "callback";

	//public static string AuthorityUri = "https://demo.identityserver.io";

	//public static string AuthorizeUri = "https://staging-xoxo.se/Account/login";
	public static string AuthorizeUri = "https://id-staging-xoxo.se/Account/login";

	public static string TokenUri = "https://id-staging-xoxo.se";

	public static string ApiUri = "https://api-staging-xoxo.se";

	public static string RedirectUri = "oauth2test://callback";
	public static string ClientId = "xoxo";
	//public static string ClientSecret = "xoxo";
	public static string Scope = "openid profile api roles userinfo";
}
private async void Button_Clicked(object sender, EventArgs e)
{
	identityService = new IdentityService(new RequestProvider());

	string url = identityService.CreateAuthorizationRequest();

	Debug.WriteLine(url);

	var authresult = await WebAuthenticator.AuthenticateAsync(
			new Uri(url),
			new Uri(Constants.RedirectUri)
			);

	string raw = ParseAuthenticatorResult(authresult);
	authorizeResponse = new AuthorizeResponse(raw);
	if (authorizeResponse.IsError)
	{
		Console.WriteLine("ERROR: {0}", authorizeResponse.Error);
	}
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
pranjalbhumijcommented, Dec 10, 2020

Hie! has this been resolved yet? The code is elegant and easy to understand. Hope this issue gets resolved

0reactions
jaysonragasacommented, Dec 10, 2020

You have to do the whole oAuth authentication manually if you do not want any web browser poping up.

The whole purpose of this code is to help with oAuth2 with IdentityServer using WebAuthentication and it uses native browser

Read more comments on GitHub >

github_iconTop Results From Across the Web

Asana never bring me back to the app after browser login
Go to the web version of Asana, click on the top right icon, select “My Settings.” Then, navigate to the “Apps” page of...
Read more >
Why users quit apps and never come back | by Appsee
One of the most discouraging statistics for all app professionals out there is that people abandon the majority of apps they download, some...
Read more >
Hide purchases from the App Store
To return to the App Store, tap Account Settings, then tap Done. Search for the app, then tap the download button .
Read more >
I Got a Laser TV And I'm Never Going Back - YouTube
Laser TVs are the way of the future - the biggest and brightest screens for home theater or for everyday use, even in...
Read more >
Never going back to the office? Facebook has an app for that.
The company is rolling out a virtual reality videoconference app as part of its "metaverse" future.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found