Skip to content

Conversation

@captainsafia
Copy link
Member

Part of #41956.

  • Set AuthenticationOptions.DefaultScheme from Authentication:DefaultScheme in config
  • Don't set default scheme when registering authentication services in WebApplicationBuilder.Authentication
  • Add GetAuthenticationConfiguration API to IAuthetnciationConfigurationProvider

@captainsafia captainsafia requested review from a team and HaoK and removed request for BrennanConroy, Tratcher and halter73 June 1, 2022 21:48
@Pilchie Pilchie added the area-auth Includes: Authn, Authz, OAuth, OIDC, Bearer label Jun 2, 2022
@captainsafia captainsafia force-pushed the default-scheme-from-config branch from 76f82a3 to f3d5d7c Compare June 6, 2022 02:08
services.AddWebEncoders();
services.TryAddSingleton<ISystemClock, SystemClock>();
services.TryAddSingleton<IAuthenticationConfigurationProvider, DefaultAuthenticationConfigurationProvider>();
services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<AuthenticationOptions>, AuthenticationConfigureOptions>());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also discuss configuration changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah at a minimum we'd have to move away from IOptions and use IOptionsMonitor for AuthenticationOptions to be able to do that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assert.NotNull(openIdConnectOptions.Get("other"));
}

private IServiceCollection GenerateServicesForTest()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really nitty (don't feel obligated to do this): GenerateTestServices? But I'm not a huge fan of method names as sentences without spaces.

return res.Body.WriteAsync(xmlBytes, 0, xmlBytes.Length);
}

public static IServiceCollection ConfigureAuthTestServices(this IServiceCollection services)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could drop Auth, ConfigureTestServices(), since this doesn't actually configure any auth services anyways.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe want to go with the same name between this one and GenerateServicesForTest for consistency too

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do this in another PR to avoid having to rekick the build again. 😓

@captainsafia captainsafia merged commit e07cdd8 into dotnet:main Jun 13, 2022
@ghost ghost added this to the 7.0-preview6 milestone Jun 13, 2022
@DamianEdwards
Copy link
Member

😀 🐼

@ghost
Copy link

ghost commented Jun 13, 2022

Hi @DamianEdwards. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-auth Includes: Authn, Authz, OAuth, OIDC, Bearer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants