Class WebAuthenticator
Handles OAuth redirection to the system browser and re-activation.
Inheritance
Inherited Members
Namespace: WinUIEx
Assembly: WinUIEx.dll
Syntax
public sealed class WebAuthenticator
Remarks
Your app must be configured for OAuth. In you app package's Package.appxmanifest
under Declarations, add a
Protocol declaration and add the scheme you registered for your application's oauth redirect url under "Name".
Methods
| Improve this Doc View SourceAuthenticateAsync(Uri, Uri)
Begin an authentication flow by navigating to the specified url and waiting for a callback/redirect to the callbackUrl scheme.
Declaration
public static Task<WebAuthenticatorResult> AuthenticateAsync(Uri authorizeUri, Uri callbackUri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | authorizeUri | Url to navigate to, beginning the authentication flow. |
System.Uri | callbackUri | Expected callback url that the navigation flow will eventually redirect to. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<WebAuthenticatorResult> | Returns a result parsed out from the callback url. |
Remarks
Prior to calling this, a call to CheckOAuthRedirectionActivation(Boolean) must be made during application startup.
See Also
| Improve this Doc View SourceAuthenticateAsync(Uri, Uri, CancellationToken)
Begin an authentication flow by navigating to the specified url and waiting for a callback/redirect to the callbackUrl scheme.
Declaration
public static Task<WebAuthenticatorResult> AuthenticateAsync(Uri authorizeUri, Uri callbackUri, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | authorizeUri | Url to navigate to, beginning the authentication flow. |
System.Uri | callbackUri | Expected callback url that the navigation flow will eventually redirect to. |
System.Threading.CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<WebAuthenticatorResult> | Returns a result parsed out from the callback url. |
Remarks
Prior to calling this, a call to CheckOAuthRedirectionActivation(Boolean) must be made during application startup.
See Also
| Improve this Doc View SourceCheckOAuthRedirectionActivation(Boolean)
Performs an OAuth protocol activation check and redirects activation to the correct application instance.
Declaration
public static bool CheckOAuthRedirectionActivation(bool skipShutDownOnActivation = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | skipShutDownOnActivation | If |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
The call to this method should be done preferably in the Program.Main method, or the application constructor. It must be called prior to using AuthenticateAsync(Uri, Uri, CancellationToken)
See Also
| Improve this Doc View SourceCheckOAuthRedirectionActivation(Nullable<AppActivationArguments>, Boolean)
Performs an OAuth protocol activation check and redirects activation to the correct application instance.
Declaration
public static bool CheckOAuthRedirectionActivation(AppActivationArguments? activatedEventArgs, bool skipShutDownOnActivation = false)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<AppActivationArguments> | activatedEventArgs | The activation arguments |
System.Boolean | skipShutDownOnActivation | If |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
The call to this method should be done preferably in the Program.Main method, or the application constructor. It must be called prior to using AuthenticateAsync(Uri, Uri, CancellationToken)