0

I am trying to set up a form with blazor webassembly and asp.net core hosted. I'm using .Net 7.

The form in client side sends the data entered by an unknown user to the api server side.

No user authenticated, it's a public form. However I want to be sure only my clent side access to my server side.

I have set up a protection antiforgerytoken based on this doc (https://codingflamingo.com/blog/mitigating-cross-site-request-forgery-csrf-in-blazor). This solution is not sufficient because the cookie is readable in javascript

What would be the right solution to handle this need?

I hope my explanations are clear, I don't have a great level of English.

2
  • You could configure basic authentication to your server side from your client side. This does not mean the user needs to be authenticated, just that your client side app has basic auth included on all requests to your server side that you configure in code. You can also explore setting up CORS between your client and server apps. Commented Sep 18, 2023 at 15:29
  • hello, I switched to a blazor server side project because I had a time constraint. I looked at basic authentication but I couldn't do what I wanted. I'll try a little later. Thanks for your help. Commented Oct 24, 2023 at 6:52

0

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.