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

Change Windows implementation with our own solution #287

Merged
merged 15 commits into from
Oct 27, 2023
Merged

Conversation

frederikprijck
Copy link
Member

@frederikprijck frederikprijck commented Oct 13, 2023

Changes

This PR replaces WinUIEx with our own implementation, heavily inspired on WinUIEx.

The reason this is being swapped is because of behavior in WinUIEx that does not allow us to use the package in its current state.

Additionally, we stripped things that we do not need, and added things we believe make sense in our case.

Checklist

@frederikprijck frederikprijck requested a review from a team as a code owner October 13, 2023 12:51
@frederikprijck frederikprijck marked this pull request as draft October 13, 2023 12:51
@frederikprijck frederikprijck changed the base branch from master to beta October 13, 2023 12:51
@frederikprijck frederikprijck changed the title [DO NOT MERGE] Test PR to verify logout works with changes to WinUIEx Change Windows implementation with our own solution Oct 26, 2023
@frederikprijck frederikprijck marked this pull request as ready for review October 26, 2023 12:54
@@ -52,6 +52,7 @@ jobs:
nuget pack nuget/Auth0.OidcClient.AndroidX.nuspec
nuget pack nuget/Auth0.OidcClient.Core.nuspec
nuget pack nuget/Auth0.OidcClient.iOS.nuspec
nuget pack nuget/Auth0.OidcClient.MAUI.nuspec
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are moving MAUI packaging to follow the same pattern as we do with other SDKs throuhg a nuspec file to better control platform specific dependencies.

@frederikprijck frederikprijck force-pushed the fix/logout branch 2 times, most recently from 5252733 to d819e8c Compare October 26, 2023 13:05
Comment on lines +80 to +87
public void OpenBrowser(Uri uri)
{
var process = new System.Diagnostics.Process();
process.StartInfo.FileName = "rundll32.exe";
process.StartInfo.Arguments = $"url.dll,FileProtocolHandler \"{uri.ToString().Replace("\"", "%22")}\"";
process.StartInfo.UseShellExecute = true;
process.Start();
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before going to GA, we will want to have a decent security review on this. It works as expected, and is also used in other packages, but does look a bit funky.

If this turns out to be an issue before we go GA, we can swap for an embedded webview implementation.

cancellationToken.ThrowIfCancellationRequested();
}

var newUri = authorizeUri.ToString().IndexOf("logout", StringComparison.CurrentCultureIgnoreCase) > -1 ? StateModifier.MoveStateToReturnTo(authorizeUri) : authorizeUri;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make this check more resilient by ensuring we do not just check for the logout string, but actualy check if the full path is v2/logout.

@frederikprijck frederikprijck merged commit bed607c into beta Oct 27, 2023
1 check passed
@frederikprijck frederikprijck deleted the fix/logout branch October 27, 2023 10:05
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

Successfully merging this pull request may close these issues.

2 participants