Skip to content

Commit

Permalink
Adds SignInScheme, SignOutScheme, ForwardSignIn, and ForwardSignOut (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
CasperWSchmidt authored Jan 25, 2024
1 parent 0a2c415 commit 0097321
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/Auth0.AspNetCore.Authentication/Auth0WebAppOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,33 @@ public class Auth0WebAppOptions
/// Sets whether to use pushed authorization requests or not.
/// </summary>
public bool UsePushedAuthorization { get; set; } = false;

/// <summary>
/// Gets or sets the authentication scheme corresponding to the middleware
/// responsible of persisting user's identity after a successful authentication.
/// This value typically corresponds to a cookie middleware registered in the Startup class.
/// When omitted, <see cref="P:Microsoft.AspNetCore.Authentication.AuthenticationOptions.DefaultSignInScheme" /> is used as a fallback value.
/// </summary>
public string? SignInScheme { get; set; }

/// <summary>
/// If set, this specifies the target scheme that this scheme should forward SignInAsync calls to.
/// For example Context.SignInAsync("ThisScheme") =&gt; Context.SignInAsync("ForwardSignInValue");
/// Set the target to the current scheme to disable forwarding and allow normal processing.
/// </summary>
public string? ForwardSignIn { get; set; }

/// <summary>
/// The Authentication Scheme to use with SignOut on the SignOutPath. SignInScheme will be used if this
/// is not set.
/// </summary>
public string? SignOutScheme { get; set; }

/// <summary>
/// If set, this specifies the target scheme that this scheme should forward SignOutAsync calls to.
/// For example Context.SignOutAsync("ThisScheme") =&gt; Context.SignOutAsync("ForwardSignOutValue");
/// Set the target to the current scheme to disable forwarding and allow normal processing.
/// </summary>
public string? ForwardSignOut { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ private static void ConfigureOpenIdConnect(OpenIdConnectOptions oidcOptions, Aut
oidcOptions.Backchannel = auth0Options.Backchannel!;
oidcOptions.MaxAge = auth0Options.MaxAge;
oidcOptions.AccessDeniedPath = auth0Options.AccessDeniedPath;
oidcOptions.SignInScheme = auth0Options.SignInScheme;
oidcOptions.ForwardSignIn = auth0Options.ForwardSignIn;
oidcOptions.SignOutScheme = auth0Options.SignOutScheme;
oidcOptions.ForwardSignOut = auth0Options.ForwardSignOut;

if (!oidcOptions.Scope.Contains("openid"))
{
Expand Down

0 comments on commit 0097321

Please sign in to comment.