User authentication parameter in expose_function

Hi,

I would like to test out the user authentication token system as presented here http://docs.elgg.org/wiki/Web_Services under "user authentication" section. So I created a plugin with one simple function, and when I expose it, I set the last parameter to "true". And now I am abit confused on how to test and use this function....

So as I understand I need to write some client code, but I dont really understand how the process of token exchange is carried out. So in my case I will need my client to be an iphone application, so would do I get a token using "http://<mysite>/service/api/rest/json/?method=auth.gettoken" ... then if so, how do i pass this token back, so that I can invoke my "http://<mysite>/service/api/rest/json/?method=<my function>&param1=<some_param>

Thank you! any help is really appreciated!

  • If you are new to this, you'll want to start with user authentication turned off until you get a handle for the client side programming.

  • I actually did start without the authentication, but am trying to add it in right now... in my client, I am obtaining the token and saving it in a variable using the auth.gettoken method in exchange for the username and password...

    I have now created a simple exposed function that takes a string parameter ("text") and just echoes it as an output... would it possible for you to provide a sample code snippet on how to use this token to get authenticated and invoke my function?

    I am trying the following functions but keep getting a white screen "send_api_call", "pam_auth_usertoken", "pam_auth_session", could you perhaps just show how to properly pass the parameters to these..

    thanks alot!!!

     

  • The instructions on the wiki for user authentication assume you have tried out api authentication. The example for api authentication is very explicit. For user authentication, the token is passed as auth_token as stated on the wiki.

    As to white screens: http://docs.elgg.org/wiki/White_page