Skip to content

Best Way to Access Open ID Connect Policy? #19178

Discussion options

You must be logged in to vote

Figured this one out. 😌🙏

The trick is to use PostConfigure but make sure to use the same name you are passing to AddOidc. Ironically PostConfigure was one of the first strategies I attempted, but I forgot the name. It must be the same as the name being used to bind configuration. Very obvious now in hindsight but I am glad I can cross this off my list:

sealed class ConfigureHostBuilder : ICommand<IHostBuilder>
{
	public static ConfigureHostBuilder Default { get; } = new();

	ConfigureHostBuilder() : this("OidcAuthentication") {}

	public ConfigureHostBuilder(string name)
	{
		_name     = name;
	}

	public void Execute(IHostBuilder parameter)
	{
		parameter
// ... omitted
		         .UseAu…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Mike-E-angelo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant