authentication - Authenticating from a cross-platform mobile application consuming data from a WebApi service -


i trying implement authenticating , identification on xamarin cross-platform mobile application consuming data webapi service have.

my goal follows:
have mobile application perform authentication against various identity providers, security token, , have passed webapi service inside requests' headers.
service implement delegatinghandler validate token, , extract userid it, later identification , authorization needs.
client code share-able as possible !

my options afaik follows:

  1. use azure mobile services generate federated security token on client side, , validate token on webapi service. think possible, this answer. code-sharing on client side looks promising, xamarin azure mobile services components.

  2. use azure access control service(acs) generate federated security token on client side, , validate token on webapi service. however, don't think consuming acs on client can code-shared. besides, acs not new guy in town...

  3. use xamarin.auth component have client side authentication directly against identity providers, generate jwt security token, , have validated on webapi service. should give more access users' data idp. @ moment component lacks windows phone support, , it's not available before late fall.

if has dealt scenario, please share experience , let me know right way go.
if goal wrong in first place, don't hesitate criticize well.

are using windows azure mobile services (wams) backend @ all? looks have own api unrelated wams.

if want use wams ability give jwt , authenticate twitter/fb & live (their supported idps), need use token handler knows how deal wams' token idiosyncrasies. (this doc shows how sign jwt).

it possible use acs, have limited number of idp (albeit more wams), , of course api have consider different token format.

you can take @ our approach type of integration in 2 tutorials wrote. oriented towards our own identity platform, sdks use open source , can @ how work (look links github repository).

xamarin tutorial

webapi / mvc tutorial

a comment on #3. not idps capable of issuing jwt. need intermediary generate (e.g. acs, service ours, etc). not idea generate token in client code, because client code "not trusted". (and secrets not stored in device).


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -