Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Gemstone.Web/Gemstone.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="9.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
Expand Down
24 changes: 24 additions & 0 deletions src/Gemstone.Web/Security/IAuthenticationWebBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,30 @@
.ConfigureGemstoneWebDefaults();
}

/// <summary>
/// Configures an authentication provider that uses OAuth to authenticate users.
/// </summary>
/// <param name="builder">The authentication builder for the application</param>
/// <param name="providerOptions">The options to configure the OAuth provider</param>
/// <returns>The authentication builder for the application.</returns>
public static AuthenticationBuilder ConfigureOAuthProvider(this AuthenticationBuilder builder, OAuthAuthenticationProviderOptions providerOptions)

Check failure on line 201 in src/Gemstone.Web/Security/IAuthenticationWebBuilder.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The type or namespace name 'OAuthAuthenticationProviderOptions' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 201 in src/Gemstone.Web/Security/IAuthenticationWebBuilder.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The type or namespace name 'OAuthAuthenticationProviderOptions' could not be found (are you missing a using directive or an assembly reference?)
{
builder.Services.AddOAuthAuthenticationProvider(providerOptions);

return builder.AddOpenIdConnect("oauth", config =>
{
config.Authority = providerOptions.Authority;
config.ClientId = providerOptions.ClientId;
config.ClientSecret = providerOptions.ClientSecret;
config.CallbackPath = "/index.html";

config.Scope.Add("openid");

foreach (string scope in providerOptions.Scopes.Split(' ', StringSplitOptions.RemoveEmptyEntries))
config.Scope.Add(scope);
});
}

/// <summary>
/// Automatically configures the request pipeline to support well-known authentication providers.
/// </summary>
Expand Down
Loading