0

The Controller in question is my "Account" controller which has actions to sign in, register, log off, recover password etc.

My application is web based but soon will also available on Android and iOS.

My idea was to reuse Account controller for authentication/authorization stuff from mobile apps too. With this in mind, I started off with creating Web API Account controller and then ended up creating multiple actions that use same verb. Runtime didn't like it and though I may be able to fix this ambiguity problem by creating multiple routes (or may be by some other means), I feel that would be sort of a hack to Web API's REST based design.

Or I can just use good old MVC controller, but then I would need to take care of mobile clients separately.

Can someone help me to design this better?

2
  • You can detect user agent and in your controller and apply logic based on that request. e.g. if request is from android perform specific action Commented May 7, 2013 at 14:21
  • You can have multiple actions with the same verb in Web API by adding {action} to your route. Commented May 8, 2013 at 15:45

1 Answer 1

0

This gets resolved with OWIN and Katana layer with Web API 2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.