Class AuthenticationBuilderExtensions
- Namespace
- Crews.PlanningCenter.Api.Extensions
- Assembly
- Crews.PlanningCenter.Api.dll
Provides extension methods for configuring OIDC authentication.
public static class AuthenticationBuilderExtensions
- Inheritance
-
AuthenticationBuilderExtensions
- Inherited Members
Methods
AddPlanningCenterAuthentication(AuthenticationBuilder)
Adds Planning Center OIDC authentication with configuration from appsettings.json. Reads from the "PlanningCenter" configuration section.
public static AuthenticationBuilder AddPlanningCenterAuthentication(this AuthenticationBuilder builder)
Parameters
builderAuthenticationBuilderThe authentication builder.
Returns
- AuthenticationBuilder
The authentication builder for chaining.
Remarks
Configuration is read from appsettings.json under the "PlanningCenter" section:
{
"PlanningCenter": {
"Authority": "https://api.planningcenteronline.com",
"ClientId": "your-client-id",
"ClientSecret": "your-client-secret",
"Scopes": ["openid", "people"] // Optional, defaults to ["openid", "people"]
}
}
ClientId and ClientSecret are required. If not configured, an exception will be thrown at startup.
Note: You must also configure cookie authentication and set the DefaultSignInScheme in AddAuthentication().
AddPlanningCenterAuthentication(AuthenticationBuilder, Action<OpenIdConnectOptions>)
Adds Planning Center OIDC authentication with custom configuration options.
public static AuthenticationBuilder AddPlanningCenterAuthentication(this AuthenticationBuilder builder, Action<OpenIdConnectOptions> configureOptions)
Parameters
builderAuthenticationBuilderThe authentication builder.
configureOptionsAction<OpenIdConnectOptions>Callback to customize OpenID Connect options.
Returns
AddPlanningCenterAuthentication(AuthenticationBuilder, string?)
Adds Planning Center OIDC authentication with a custom sign-in scheme.
public static AuthenticationBuilder AddPlanningCenterAuthentication(this AuthenticationBuilder builder, string? signInScheme)
Parameters
builderAuthenticationBuilderThe authentication builder.
signInSchemestringThe scheme to use for signing in. If null, uses the DefaultSignInScheme from AddAuthentication().
Returns
AddPlanningCenterAuthentication(AuthenticationBuilder, string?, Action<OpenIdConnectOptions>?)
Adds Planning Center OIDC authentication with full customization options.
public static AuthenticationBuilder AddPlanningCenterAuthentication(this AuthenticationBuilder builder, string? signInScheme, Action<OpenIdConnectOptions>? configureOptions)
Parameters
builderAuthenticationBuilderThe authentication builder.
signInSchemestringThe scheme to use for signing in. If null, uses the DefaultSignInScheme from AddAuthentication().
configureOptionsAction<OpenIdConnectOptions>Optional callback to customize OpenID Connect options.