asp.net mvc - Shared Authentication and HttpContext Session between WebAPI and MVC running on separate servers -


i have mvc 4.5 application serves website content - using bundling , routing, pretty basic.

on checkout page multi-step form uses knockoutjs.

i have seperate web service accepts orders via ajax knockoutjs checkout submission.

the sites run on different servers (https://www.myapp.com , https://api.myapp.com).

the idea use token fetched api , used during api communications.

for other parts of site there submission captcha type field,

from code here session used context.httpcontext.session["captchastring"] = randomstring;. similarly, need store calculated value user's session can identify individual checkouts , verify captcha (and other things) on submission.

as can't share context between 2 different web server processes, guess double dispatch mvc web server asking api session token , rendering view token built in feels clunky.

i have 2 questions:

  1. am going wrong, or bite bullet , put parts of app in webapi within same mvc application sessions can shared?

  2. what other authentication schemes exist useful above?

you can make api project used authentication. mvc project , api project use third api authentication.

but since have token based authentication, token saved db nad supose both project use same database can vlaidate token. better practice put toke request header.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -