Skip to content

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

Closed

Description

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.

Activity

  1. jmprieur commented on Dec 3, 2020

    @jmprieur
    Collaborator

    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

  2. added this to the 1.4.0 milestone on Dec 3, 2020
  3. self-assigned this
    on Dec 3, 2020
  4. jennyf19 commented on Dec 9, 2020

    @jennyf19
    Collaborator

    Included in 1.4 Release.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions