Skip to content

Instantly share code, notes, and snippets.

@hatsunea
Created November 24, 2024 10:47
Show Gist options
  • Save hatsunea/e173a0693606321cd931c4035c2ddc38 to your computer and use it in GitHub Desktop.
Save hatsunea/e173a0693606321cd931c4035c2ddc38 to your computer and use it in GitHub Desktop.
internal void GetToken(string url)
{
this.IsWebViewVisible = this.WebViewSource.Length > 0;
if (url.StartsWith("https://jwt.ms/#access_token="))
{
var uri = new Uri(url);
var query = HttpUtility.ParseQueryString(url.Replace("https://jwt.ms/#", ""));
var access_token = query.Get("access_token");
this.Token = access_token ?? string.Empty;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment