3

We have a large legacy web forms application. We would like to continue to extend the functionality of it (add new pages). But we would like to stop adding more Web Forms code and instead would like to use Blazor to develop all new features going forward.

Ideally, a link from a Web Form page would redirect the browser to a page served by a Blazor app and vice-versa and the transition would be indistinguishable to the user.

Is this possible? If yes, how can it be done?

Also, what about authentication? Ideally, the user would login in our existing Web Form app and would not need to login again when transitioning to the Blazor app.

1
  • Seconding Henk, you are looking for single signon. Look OAuth / openId or SAML. Essentially you would have two applications, but you would be able to automatically sign users into your blazor app from your web forms app. Commented Jan 15, 2020 at 23:41

1 Answer 1

1

What I did:

Host the blazor application in a subfolder under the existing app:

myapp.com/oldapp

myapp.com/oldapp/blazor

You can just add links between them, If you use the same layout users should not notice.

Now because you are using the same hostname, you can issue a cookie with a JWT token on login in the old app, and because the new app runs on the same hostname the blazor app can pickup this cookie and use the token to do requests to a new backend API that is also using JWT auth.

Sign up to request clarification or add additional context in comments.

3 Comments

This was Blazor Wasm. The cookie does not need to be compatible, it just holds the JTW token, and is picked up in the blazor part.
I'm trying to host a Blazor app in a subfolder under an existing Web Forms app, can you please point me into the right direction with any resource? I've tried multiple things but I just can't, I'm new with Blazor and I haven't worked with Web Forms before

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.