Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8498307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:22:00+00:00 2026-06-11T00:22:00+00:00

I want to host an MVC 4 Web API project on Azure. I need

  • 0

I want to host an MVC 4 Web API project on Azure. I need to make sure the APIs can be accessed from any third-party app and any browser. Implementing a RESTful API that simply returns JSON sounds like a good idea to me. Now, the biggest challenge to me is creating a platform-agnostic authentication mechanism. I don’t want to use the default MembershipProvider. I’ll be using SSL. I also won’t use FormsAuthentication. All API calls are going to be through JQuery/AJAX.

I’m trying to understand token-based authentication. Here’s what I thought I could do:
– Client sends their user credentials to the server over HTTPS
– Server authenticates the client, creates a token, saves it to the DB along with a date-time stamp and expiration period, and sends it back to the client
– Client sends the token to the server every time they access an API

Now, the part I don’t understand is, where does the client store the token? Is it saved in a cookie? If so, where do non-browser third party apps save the authentication token? How easily is the token stolen?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:22:02+00:00Added an answer on June 11, 2026 at 12:22 am

    The authentication token is stored in cookie by the ASP.net membership provider and authentication module. On the client side the HTTP client library can deal with cookies. The cookieless authentication is also possible with forms authentication. If the channel is not encrypted(ssl or https) then the token can be stolen by the middle man sniffers. Secure websapps sets a small timeout for the authentication cookie so that a small period of inactivity will expire the session thus the cookie.

    However for API authentication the authentication mechanism can be different. Each call can be independently authenticated. So there is no need to maintain a token for the client. The Authorization header for each API call should have some secret that server can identify. Amazon AWS uses this style of API authentication and many other followed this style. With webapi you can implement this kind of authentication.

    1. The client has a private key for his account issued by the server or imported into the server for the account by the user.

    2.The client calls the API as usual but puts some information into the Authorization header. The information would be HMAC of data being send mixed with account id of the client and the date.

    Here is how the authorization header in HTTP API should look like

    Authorization: account-id  HMAC_OF_WITH_SECRET_KEY(data + account-id + GMT Date that will be in date header)
    

    3.On the server side( WebApi side )you need have custom AuthorizeAttribute for the WebApi controllers. These custom authentication will receive the requests from client and do reverse of what client has done. The server has client private key and it can arrange the data as client has done and again calculate the HMAC. If this HMAC is same as that of what is send in Authorization header then it is authenticate client for the account or user id. Note that the authorization header has the account-id + HMAC secret. So using the account-id or user-id in this header server can know which client is requesting.

    This mechanism covers authentication as well as data integrity.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to host a tomcat server, which will host 3 web applications. I
Here's the situation. What I am working with: - ASP.NET MVC 4 Web API
I have used .net framework 4.0 to design my web project I want to
I want to host multiple web sites (all with different domains - not sub
I want to host an ical file, but when serving it, I need to
Is it possible to host an ASP.net (MVC in particular, but I'm not sure
I want to host a wcf service on Azure, but this instantiation must be
I've an ASP.NET MVC 3 project and have been tasked with implementing a few
Okay, so I am creating an MVC framework in PHP and I want it
The host that I want to host with does not support server side url

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.