locked
ASP .NET WEB API RRS feed

  • Question

  • User-1469539208 posted

    I am developing a web API which is provide service to  resister user.after registered  user can login using client application the session object should be set  to recognize particular user. i am confuse which side is most suitable for create session object  client or server side.

    should use  any thread based program  to handle multiple client. when host the api it is automatically handle multiple user ?

    any one can explain me 

    Sunday, July 1, 2018 12:52 PM

All replies

  • User36583972 posted


    Hi pubuduNuwan,

    ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework.

    I am developing a web API which is provide service to  resister user.after registered  user can login using client application the session object should be set  to recognize particular user. i am confuse which side is most suitable for create session object  client or server side.

    You can save session object on client and pass the object to the API.

    I suggest you can refer the following official sample which explains how to authorize access to API resources through the following steps. It will deepen your understanding.

    1:The user enters a name and password into the client.
    2:The client sends these credentials to the authorization server.
    3:The authorization server authenticates the credentials and returns an access token.
    4:To access a protected resource, the client includes the access token in the Authorization header of the HTTP request.

    Secure a Web API with Individual Accounts and Local Login in ASP.NET Web API 2.2
    https://docs.microsoft.com/en-us/aspnet/web-api/overview/security/individual-accounts-in-web-api

    Best Regards,

    Yong Lu

    Monday, July 2, 2018 7:43 AM
  • User-1469539208 posted

    Thanks Yohann Lu 

    Monday, July 2, 2018 8:31 AM