0

I've got a native app that will allow registration with the same elements that Joomla uses for registration.

I believe this post is the most relevant. It is based on Joomla 1.5 and I want to build this for 2.5. There is one answer based on 2.5 from @mavrosxristoforos. But I want to build this as a component inside Joomla instead of an external script.

I want to call the usual com_user component to register the user because I have an entire process flow with a payment processor so keeping it in Joomla is important. This post seems to outline what I want with the first option.

What I don't understand is how I would call the registration process via a URL. The POST for registering seems to be:

http://myhost.com/component/users/?task=registration.register

Is there a way to create my own URL that can pass the details needed? i.e.

http://myhost.com/component/users/?task=registration.register&user=blah&password=foo...

If this is possible then there will be another problem which is the token generation. Can that be generated externally so I don't have to comment it out like the post does (which seems highly insecure)?

Community
  • 1
  • 1
Tom
  • 2,604
  • 11
  • 57
  • 96

2 Answers2

1

Yes You can do that.

You can pass the values through url for registering to joomla sites.Only the things the url params should be similar to the reg from.

The issue with token also you can fix .

If your external APP is running on the same joomla installed server.Then you can keep one file in root and load joomla frame work to that file and create the token there and then post the user data . For this link will help you.. Then you can use token creation using

JHtml::_('form.token');

Hope this may help you..

Community
  • 1
  • 1
Jobin
  • 8,238
  • 1
  • 33
  • 52
  • Thanks for the response. How would you pass values through the url? Where can I find the url params that I shoudl use? – Tom Jan 30 '13 at 13:43
  • Just check your normal joomla registration form field names and use the same name are query string,Check the form contain a task just call that url like wht u give in your example. – Jobin Jan 30 '13 at 13:59
  • Ah perfect, I think it is working but I get the invalid token so hard to say. My external app is a mobile native app (i.e. Android/iOS) so it is not running on the same server. Is it still possible to work around the invalid token? – Tom Jan 30 '13 at 14:16
  • Ya one option is there just use firebug and inspect a valid token from registration form and use that ,normally joomla support that but need to check and confirm this. – Jobin Jan 30 '13 at 15:16
  • I think you mean just to test what I got working? But I need a long term solution. I need to generate the token somehow but not sure how to tackle that. – Tom Jan 30 '13 at 15:30
  • I told you the proper option if the things on same server it will works,But i am not sure second option but try that It works more than one time that means forever until you update the joomla site. – Jobin Jan 30 '13 at 15:37
0

I really don't think this is possible to get around the token issue. In the end this post answers the way do it. I went with a Joomla component with an Oauth2 implementation for my native app (iOS/Android) implementation.

This original post is the way to go but don't follow the solution for Joomla 2.5. Take a look at the responses that say they are tested for 2.5.

Community
  • 1
  • 1
Tom
  • 2,604
  • 11
  • 57
  • 96