public static OpenIddictBuilder AllowDeviceCodeFlow(this OpenIddictBuilder builder) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } return(builder.Configure(options => options.GrantTypes.Add(DeviceCodeFlowConstants.GrantTypes.DeviceCode) )); }
public void Configure_OptionsAreCorrectlyAmended() { // Arrange var services = CreateServices(); var builder = new OpenIddictBuilder(services); // Act builder.Configure(configuration => configuration.AccessTokenLifetime = TimeSpan.FromDays(1)); var options = GetOptions(services); // Assert Assert.Equal(TimeSpan.FromDays(1), options.AccessTokenLifetime); }
public void Configure_OptionsAreCorrectlyAmended() { // Arrange var services = new ServiceCollection(); services.AddOptions(); var builder = new OpenIddictBuilder(services); // Act builder.Configure(configuration => configuration.Description.DisplayName = "OpenIddict"); var provider = services.BuildServiceProvider(); var options = provider.GetRequiredService <IOptions <OpenIddictOptions> >(); // Assert Assert.Equal("OpenIddict", options.Value.Description.DisplayName); }