aspnet / Identity

[Archived] ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
1.96k stars 868 forks source link

Can Web Api generate a _ValidationScriptsPartial #1849

Closed Caizhenyu closed 6 years ago

Caizhenyu commented 6 years ago

I want to create a Web Api project and i want to use Identity. I know in MVC' script, there is @await Html.PartialAsync("_ValidationScriptsPartial"), but in api project, can i get a _ValidationScriptsPartial or other property the same use?

blowdart commented 6 years ago

I don't understand your question. What are you trying to achieve?

Caizhenyu commented 6 years ago

@blowdart , thank you and sorry , it's not clear . I want to implement a identity system by using net core identity, and the system isn't a mvc project, it just a api project. so i need generate a Antiforgery token. I found my answer here https://docs.microsoft.com/en-us/aspnet/core/security/anti-request-forgery

blowdart commented 6 years ago

Ah thanks! One other option I'd look at is IdentityServer, so you'd use OIDC to get a token to authenticate against the API project through the authorization header. Which is nice and standard.