cornflourblue / aspnet-core-3-signup-verification-api

ASP.NET Core 3.1 - Boilerplate API with Email Sign Up, Verification, Authentication & Forgot Password
https://jasonwatmore.com/post/2020/07/06/aspnet-core-3-boilerplate-api-with-email-sign-up-verification-authentication-forgot-password
MIT License
226 stars 93 forks source link

How I can consume this API in MVC client? #17

Closed iozcelik closed 3 years ago

iozcelik commented 3 years ago

I am learning security for API and I want to implement in client MVC application. However, I don't find any good example or tutorial for MVC client. Lots of examples explain, how consume in SPAs.

AcidRaZor commented 3 years ago

Did you read the article examples? It includes both Angular and React examples for you

https://jasonwatmore.com/post/2020/07/06/aspnet-core-3-boilerplate-api-with-email-sign-up-verification-authentication-forgot-password#running-react

iozcelik commented 3 years ago

Yes, I read all of them. However, I dont want to use SPA. I try to use MVC, httpclientfactory and requestdelegate.

AcidRaZor commented 3 years ago

I just googled "Consume an API in C#"

This was it's top result: https://www.c-sharpcorner.com/article/consuming-asp-net-web-api-rest-service-in-asp-net-mvc-using-http-client/

It explains how to make WebAPI calls from an MVC application using HttpClient. If there is a specific implementation you're after using HttpClientFactory and a RequestDelegate, I will leave that up to your skills to figure out. However, abovementioned URL will get you going and is not an SPA

iozcelik commented 3 years ago

Thanks, I also found that solution too. However, your api implementation seems better than others (also I googled it), so I want to ask you.

Everybody makes different. I am new .net core web world. Until this time, I write background services. So I try to figured out how I will do better.

Thanks for answers.