3

Once I have created my Web App with Zend2 , zfcUser and bjyAuthorize it's time to create the mobile App.

Our approach is to create and app with a json interaction with the Zend2 background.

The problem is that I don't know where to start in order to deal with a jSon Auth. Is possible wit zfcUser? any example out there?

Thanks in advance

pekechis
  • 288
  • 6
  • 18

1 Answers1

1

ZfcUser module provides support for additional authentication mechanisms via plugins (Google, Facebook, LDAP, etc), but this feature seems to be in development now.

If you need that your mobile application to authenticate through some custom protocol based on JSON format, all you have to do is to create a controller action (say, mobileAuthAction()) which takes a JSON array with user credentials from POST, uses zfcUser API to authenticate the user, and return the response in JSON format. You may also look at view_manager configuration key to adjust the rendering strategy for your action to allow it to return JSON. Alternatively, you may call the $viewModel->setTerminal(false) to disable the layout rendering and echo your JSON to standard output.

OlegKrivtsov
  • 752
  • 4
  • 9
  • are there any blog posts / hints that detail further this method? Specifically the `view_manager` actions needed to have a JSON only response for all these requests. I want to completely decouple the view from ZFCUser – Erik Apr 22 '14 at 23:36
  • how does one modify or customize `ZfcUser` with this new `mobileAuthAction()` ? not in the `../vendor/` area I'd imagine.. right? – Erik Apr 23 '14 at 00:12