-
-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Boilerplate social sign-in (#9620)
- Loading branch information
Showing
9 changed files
with
58 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 12 additions & 4 deletions
16
...Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/Contracts/ILocalHttpServer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
namespace Boilerplate.Client.Core.Services.Contracts; | ||
|
||
/// <summary> | ||
/// Social sign-in functions seamlessly on web browsers and on Android and iOS via universal app links. | ||
/// However, for blazor hybrid, a local HTTP server is needed to ensure a smooth social sign-in experience. | ||
/// </summary> | ||
public interface ILocalHttpServer | ||
{ | ||
int Start(CancellationToken cancellationToken); | ||
|
||
/// <summary> | ||
/// Social sign-in on the web version of the app uses simple redirects. However, for Android, iOS, Windows, and macOS, social sign-in requires an in-app or external browser. | ||
/// | ||
/// # Navigating Back to the App After Social Sign-In | ||
/// 1. **Universal Deep Links**: Allow the app to directly handle specific web links (for iOS and Android apps). | ||
/// 2. **Local HTTP Server**: Works similarly to how `git.exe` manages sign-ins with services like GitHub (supported on iOS, Android, Windows, and macOS). | ||
/// | ||
/// - **iOS, Windows, and macOS**: Use local HTTP server implementations in MAUI and Windows projects. | ||
/// - **Android**: Use universal links. | ||
/// </summary> | ||
bool UseLocalHttpServerForSocialSignIn(); | ||
} |
11 changes: 6 additions & 5 deletions
11
...rplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/NoopLocalHttpServer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
namespace Boilerplate.Client.Core.Services; | ||
|
||
/// <summary> | ||
/// <inheritdoc cref="ILocalHttpServer"/> | ||
/// The <see cref="NoopLocalHttpServer"/> is specifically registered for Android, iOS, and Web, where a local HTTP server is unnecessary. | ||
/// </summary> | ||
public partial class NoopLocalHttpServer : ILocalHttpServer | ||
{ | ||
public int Start(CancellationToken cancellationToken) => -1; | ||
public int Start(CancellationToken cancellationToken) => throw new NotImplementedException(); | ||
|
||
/// <summary> | ||
/// <inheritdoc cref="ILocalHttpServer.UseLocalHttpServerForSocialSignIn"/> | ||
/// </summary> | ||
public bool UseLocalHttpServerForSocialSignIn() => false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters