0

Firstly I appologize for my spelling and for being a newbie in advance.

I have built an asp.net 5 mvc 6 server where when users login through my web and make further requests I can verify the user's authentication by simply using the [authorize] attribute for my controller/action. I am now building an android app and wish to implement a login system to my server that utilizes the asp.net mechanism. Therefore I have built a controller that calls the signinmanager to sign in my android app users. When the android app tries to make other requests that are flagged by the authorize attribute instead of getting the request result, their request is being forwarded to the webapp's login action which means they are unauthroized.

I understand that there is some background session management in the webapp and wish to implement it through the android app. How do I make my android app web requests to my server pass the authroized attribute check?

Thanks in advance!

kindasorta
  • 121
  • 2
  • You need to work on your architecture!! Ideally, you should have WebAPI which can be consumed by both MVC and Mobile. – techspider May 27 '16 at 17:31
  • I would assume it should be something "simple" like adding some cookie that the server might create after the login process :) – kindasorta May 27 '16 at 17:53
  • I have found the answer in: http://stackoverflow.com/questions/11014953/asp-net-web-api-authentication – kindasorta May 27 '16 at 22:05

1 Answers1

0

The problem was that indeed as I assumed - I did not add the cookie achieved from the login httpwebresponse to the new request. In case there shall be any requests I can post really elegant code that I have written especially for this that wraps my GET/POST requests, adds the request parameters and the cookies that works with my ASP.NET 5 MVC6 web server.

kindasorta
  • 121
  • 2