Announcement

#1 2014-02-06 02:57:28

convolution
Member
2014-01-28
2

Performing auto login from iOS App

Hi,

Piwigo ver.:   2.5.3.

Our team is writing a simple iOS app for auto login but got the following error message:

"stat": "fail","err";1002,"message":"Missing parameters: username, password"}

The portion of the iPhone/iPad app code is as follows:

    [request setURL:[NSURL URLWithString:@"http://av.samplepiwigo.com/ws.php?format=json&method=pwg.session.login"]];
   
    [request setHTTPMethod:@"POST"];

    // [request setValue:postLength forHTTPHeaderField:@"Content-Length"];
    [request setValue:@"text/html" forHTTPHeaderField:@"Content-Type"];
   
    // NSString *post = @"username=[username]&password=[password]";
    NSString *post = @"[username]&[password]";

inside [...] are user parameters.

The thing our team uncertain is whether we're using the correct URL (...ws.php?...) and format of the username and password above.

Can anyone please kindly advise?

Offline

 

#2 2014-02-06 09:50:40

rvelices
Former Piwigo Team
2005-12-29
1960

Re: Performing auto login from iOS App

the url is correct (because the answer is clear - you called the right method)
however the received username and password are either inexistent or empty. I cannot help on this one as I don't know ios

Offline

 

#3 2014-02-07 10:54:14

ctsang
Guest

Re: Performing auto login from iOS App

After some testing, I think we manage to get authentication successfully.

We get the reply: {"stat":"ok", "result":true}

Yet, as different from web-based login, we don't get the webpage after successful login. We've just got the above one-line message.

May I ask what is the link to proceed to load after a successful login?

 

#4 2014-02-07 13:10:58

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: Performing auto login from iOS App

I don't think you really get how a webservice works : it only exposes raw data and logical methods
once you are logged you can perform requests on other methods

but I didn't tell us what you want to achieve but I think it's no more directly related to Piwigo and you will get more help on specialized forums

Offline

 

#5 2018-05-31 20:36:12

Lorenzo4web
Member
2014-06-29
32

Re: Performing auto login from iOS App

hello

there is any option that allowed me to connect to the album with a specific username and password from ios?

have anyone done it?

thanks

Offline

 

#6 2018-06-06 16:54:03

cryopad
Piwigo Team
Grenoble, France
2015-11-01
191

Re: Performing auto login from iOS App

Hi,

You may have a look here: https://github.com/Piwigo/Piwigo-Mobile

Cheers


If you enjoy Piwigo for iOS…
➤ We would appreciate an AppStore review.
➤ Comments, suggestions ? Tell us on GitHub…
➤ Not yet available in your language ? Help us translate it…

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact