Account Linking with ASP.NET/Blazor

I have normal auth and a social provider working. Now I want to implement account linking.

I’m using Blazor Server.

The issue I’m having is that I don’t see a way to override the /callback on a per request basis like the example shows here in javascript. auth0-link-accounts-sample/RegularWebApp/lib/routes/link.js at f13f33940628c9538f37c624ec6a7ccd1370fb2f · auth0-samples/auth0-link-accounts-sample · GitHub

I see that I can set the CallbackPath in the options, but that is global.

My goal is:

  1. User logs in with normal auth0 auth.
  2. User goes to profile page.
  3. User clicks “Link to social site” button
  4. User logs into social site
  5. User is redirected back to the profile page showing the connection.

What is happening is on #4, that authentication overrides the original authentication.

My thought is that for social login only, I need to override the /callback handler.

Is that possible or should I override the default /callback handler and detect:

  1. If normal login then carry on with base implementation
  2. If social login, then override and don’t see the auth cookie.