Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Cannot add new routes to the endpoint router #1364

Closed
scottbrady91 opened this issue Jul 27, 2017 · 8 comments
Closed

Cannot add new routes to the endpoint router #1364

scottbrady91 opened this issue Jul 27, 2017 · 8 comments
Assignees

Comments

@scottbrady91
Copy link
Member

Cannot use the AddEndpoint in the BuilderExtensions due to the use of the EndpointName enum.

Endpoints registered by:

public static IIdentityServerBuilder AddEndpoint<T>(this IIdentityServerBuilder builder, EndpointName endpoint) where T : class, IEndpoint {
  builder.Services.AddTransient<T>();
  builder.Services.AddSingleton(new EndpointMapping { Endpoint = endpoint, Handler = typeof(T) });

  return builder;
}

EndpointName is then registered using Constants.EndpointPathToNameMap:

public static readonly Dictionary<string, EndpointName> EndpointPathToNameMap

These are then used in the EndpointRouter to figure out the EndpointName from the path, and be matched back to the registered endpoint.

But you can't extend an enum, so endpoints outside of the OIDC spec cannot currently be registered.

@leastprivilege
Copy link
Member

@brockallen e.g. to add saml2p (or ws-fed) endpoints...we should discuss this for 2.0

@scottbrady91
Copy link
Member Author

Will this apply to ASP.NET Core 1.x too? Or do you want people to go the controller route for that?

@brockallen
Copy link
Member

We can do this for 2.0, but 1.x might be too much work... and it might technically be a breaking change.

@scottbrady91
Copy link
Member Author

Could we get some extra enum values for 1.x?

@brockallen
Copy link
Member

brockallen commented Aug 1, 2017

You already have several:

(EndpointName)(EndpointName.UserInfo+1)
(EndpointName)(EndpointName.UserInfo+2)
(EndpointName)(EndpointName.UserInfo+3)

:)

@brockallen
Copy link
Member

Do we want to allow our endpoints to be replaced? e.g. /authorize, etc?

@brockallen
Copy link
Member

brockallen commented Sep 13, 2017

Do we want to allow our endpoints to be replaced? e.g. /authorize, etc?

I think the outcome of our conversation was "no" that's not something we're trying to design for.

@lock
Copy link

lock bot commented Jan 14, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants