Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a method to IServiceCollection, for Razor, to add a consent handler #805

Closed
bakerCaleb opened this issue Dec 3, 2020 · 2 comments
Closed
Assignees
Labels
enhancement New feature or request fixed
Milestone

Comments

@bakerCaleb
Copy link

Is your feature request related to a problem? Please describe.
When writing a Razor web app, I'd like to add a consent handler. There is no available method. I'm using the one for Blazor, which I think will work, but it is confusing and I'm not confident it is the correct approach.

Example from ConfigureServices() in Startup.cs:

services.AddServerSideBlazor()
.AddMicrosoftIdentityConsentHandler();

Describe the solution you'd like
I'd like something like:
services.AddServerSideRazor()
.AddMicrosoftIdentityConsentHandler();

Describe alternatives you've considered
If it's the same code for Razor and Blazor, maybe just make it neutral, like:

services.AddServerSide()
.AddMicrosoftIdentityConsentHandler();

Additional context
Add any other context or screenshots about the feature request here.

@bakerCaleb bakerCaleb added the enhancement New feature or request label Dec 3, 2020
@jmprieur
Copy link
Collaborator

jmprieur commented Dec 3, 2020

The AddMicrosoftIdentityConsentHandler does not use the IServerSideBlazorBuilder

public static IServerSideBlazorBuilder AddMicrosoftIdentityConsentHandler(
this IServerSideBlazorBuilder builder)
{
if (builder == null)
{
throw new ArgumentNullException(nameof(builder));
}
builder.Services.TryAddEnumerable(ServiceDescriptor.Scoped<CircuitHandler, MicrosoftIdentityServiceHandler>());
builder.Services.TryAddScoped<MicrosoftIdentityConsentAndConditionalAccessHandler>();
return builder;
}
}

Lets add an overrides that takes an IServiceCollection and returns it

@jennyf19 jennyf19 added this to the 1.4.0 milestone Dec 3, 2020
@jennyf19 jennyf19 self-assigned this Dec 3, 2020
@jennyf19 jennyf19 added fixed and removed In progress labels Dec 4, 2020
@jennyf19
Copy link
Collaborator

jennyf19 commented Dec 9, 2020

Included in 1.4 Release.

@jennyf19 jennyf19 closed this as completed Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed
Projects
None yet
Development

No branches or pull requests

3 participants