ASP.NET MVC 5 and WEB API use Same Authentication

Arda Güçlü

I am developing a web site with using ASP.NET MVC 5 and WEB API template. I use individual accounts feature of this template. However, WEB API has its own account controller and controls authentication mechanism using it. ASP.NET MVC 5 also has its own account controller.

How can i use both staff in the same authentication mechanism. Or are they in the same authentication, although they use different accountcontroller from each other?

elolos

The answer to your question is rather simple. You need both account controllers so that clients calling the MVC controller (e.g. browsers) and clients calling the web api controller (e.g. ajax requests, fiddler etc) can authenticate.

If both controllers are part of the same domain and application then they by default use the same authentication mechanism behind the scenes, even though you can still override this behaviour.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

ASP.NET MVC 및 WEB API

분류에서Dev

의존성 주입 및 ASP.net MVC 5 / Web API 2

분류에서Dev

ASP.NET MVC 5 및 WEB API는 동일한 인증을 사용합니다.

분류에서Dev

ASP.NET MVC web API request limits

분류에서Dev

ASP.NET MVC not work with Forms Authentication

분류에서Dev

Mocking HttpContext for Web API Controllers in ASP.NET 5

분류에서Dev

ASP.NET MVC 5 Identity 2.0 & OWIN Two Factor Authentication by using existing DB

분류에서Dev

Calling Classic ASP from ASP.NET MVC5 Controller on the same server

분류에서Dev

How to use Unity MVC & Unity WebAPI in the same ASP.Net MVC project

분류에서Dev

ASP.NET MVC 5 및 Web API 2로 업그레이드 한 후 Nuget DLL 지옥을 해결하는 방법

분류에서Dev

ASP.NET MVC 5 Web API2에 대한 나머지 클라이언트 로그인

분류에서Dev

ASP.Net MVC and Web Forms applications using same domain name, but code is kept in separate solutions

분류에서Dev

How can I deploy an ASP.NET MVC 5 Web App to a Virtual Network in Azure

분류에서Dev

web.config asp.net mvc 5의 serilog AppSetting

분류에서Dev

ASP.NET MVC 및 모바일 장치에서 ASP.NET Web API 사용

분류에서Dev

Web API and MVC in the same project with Session States

분류에서Dev

ASP.NET MVC / Web Api 공통 권한 부여 및 인증

분류에서Dev

ASP.net MVC 4 WEB API 컨트롤러에서 byte [] 반환

분류에서Dev

Asp.Net MVC 5 - Favicon

분류에서Dev

ASP.NET MVC 5 DropDownListFor AutoComplete

분류에서Dev

Asp.net share forms authentication by two applications in the same domain

분류에서Dev

asp.net MVC5에서 API를 호출하는 방법

분류에서Dev

.net 4.5.1에서 MVC5, Web API와 함께 Roslyn 사용

분류에서Dev

Use WebControl in ASP.NET MVC project

분류에서Dev

ASP.net MVC 웹 API + Android

분류에서Dev

Authentication in MVC 5

분류에서Dev

Web API에서 ASP.NET Core Web MVC를 호출하는 방법

분류에서Dev

System.Web.Mvc에 대한 참조가없는 ASP.NET Web API 2의 StructureMap

분류에서Dev

Asp.net web api services

Related 관련 기사

  1. 1

    ASP.NET MVC 및 WEB API

  2. 2

    의존성 주입 및 ASP.net MVC 5 / Web API 2

  3. 3

    ASP.NET MVC 5 및 WEB API는 동일한 인증을 사용합니다.

  4. 4

    ASP.NET MVC web API request limits

  5. 5

    ASP.NET MVC not work with Forms Authentication

  6. 6

    Mocking HttpContext for Web API Controllers in ASP.NET 5

  7. 7

    ASP.NET MVC 5 Identity 2.0 & OWIN Two Factor Authentication by using existing DB

  8. 8

    Calling Classic ASP from ASP.NET MVC5 Controller on the same server

  9. 9

    How to use Unity MVC & Unity WebAPI in the same ASP.Net MVC project

  10. 10

    ASP.NET MVC 5 및 Web API 2로 업그레이드 한 후 Nuget DLL 지옥을 해결하는 방법

  11. 11

    ASP.NET MVC 5 Web API2에 대한 나머지 클라이언트 로그인

  12. 12

    ASP.Net MVC and Web Forms applications using same domain name, but code is kept in separate solutions

  13. 13

    How can I deploy an ASP.NET MVC 5 Web App to a Virtual Network in Azure

  14. 14

    web.config asp.net mvc 5의 serilog AppSetting

  15. 15

    ASP.NET MVC 및 모바일 장치에서 ASP.NET Web API 사용

  16. 16

    Web API and MVC in the same project with Session States

  17. 17

    ASP.NET MVC / Web Api 공통 권한 부여 및 인증

  18. 18

    ASP.net MVC 4 WEB API 컨트롤러에서 byte [] 반환

  19. 19

    Asp.Net MVC 5 - Favicon

  20. 20

    ASP.NET MVC 5 DropDownListFor AutoComplete

  21. 21

    Asp.net share forms authentication by two applications in the same domain

  22. 22

    asp.net MVC5에서 API를 호출하는 방법

  23. 23

    .net 4.5.1에서 MVC5, Web API와 함께 Roslyn 사용

  24. 24

    Use WebControl in ASP.NET MVC project

  25. 25

    ASP.net MVC 웹 API + Android

  26. 26

    Authentication in MVC 5

  27. 27

    Web API에서 ASP.NET Core Web MVC를 호출하는 방법

  28. 28

    System.Web.Mvc에 대한 참조가없는 ASP.NET Web API 2의 StructureMap

  29. 29

    Asp.net web api services

뜨겁다태그

보관