Closed (fixed)
Project:
Services
Version:
7.x-3.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Apr 2011 at 16:16 UTC
Updated:
18 Jul 2012 at 20:33 UTC
Jump to comment: Most recent file
Comments
Comment #1
kylebrowning commentedKeys are no longer supported in 3.x look into using something like oauth.
Comment #2
pumpkinkid commentedSo does that mean that the example application for the Drupal IOS SDK located (https://github.com/workhabitinc/drupal-ios-sdk-example) has to be modified to work with another authentication method?
Comment #3
kylebrowning commentedNo, have a look at the 3.x branch
https://github.com/workhabitinc/drupal-ios-sdk/tree/7.x-3.x
https://github.com/workhabitinc/drupal-ios-sdk-example/tree/6.x-3.x
Comment #4
kylebrowning commentedAlso, you should be using the D7 code thats here on drupal.org
git clone --branch 7.x-3.x kylebrowning@git.drupal.org:project/services.git
Comment #5
pumpkinkid commentedI must be missing something basic then... The Sample app loads and builds correctly.. I have changed the DIOSConfig.h file to show:
and I have checked to make sure http://10.1.1.172/iosdev/ios is the correct address (it does show a blank page).
Comment #6
kylebrowning commentedAnd whats your issue then?
Comment #7
pumpkinkid commentedoops... forgot to explain what I'm seeing in the simulator...
Basically I keep getting "HTTP/1.0 Not Acceptable: Missing required argument account" When trying to get the user with "1" in the field. I also keep getting similar errors on other methods...
Comment #8
kylebrowning commentedHrmm, Make sure you are using the 7.x versino that exists on the website.
Which version of rest_server_plist are you using?
Try this one.
I just tested it and it worked fine, https://skitch.com/kylebrowning/r2a6j/ios-simulator-ipad-ios-4.3-8f190
Comment #9
pumpkinkid commentedI'm pretty sure that's the same version I was using, but I did replace it to make sure... still no go... Any permissions that could be causing this?
Comment #10
kylebrowning commentedI dont think so, Whats the timestam of your 7.x services.info?
Comment #11
pumpkinkid commented2011/01/27 03:16:00
Comment #12
kylebrowning commentedYeah thats extremely outdated, http://ftp.drupal.org/files/projects/services-7.x-3.x-dev.tar.gz try this?
Comment #13
pumpkinkid commentedWell it seems to be better now... It's now saying "Authentication Needed" so I take it I need to have an Authentication Module enabled... Any preference?
Comment #14
kylebrowning commentedThats a permissoins issue, make sure anonymous can do a user get :P
Also try logging in with admin, although im not 100% sure if the 7.x-3.x version persists the login between tabs, an easy fix is close and restart the simulator after logging in.
Comment #15
pumpkinkid commentedI tried logging in and it does the same thing... even for Node Get... Stiil says "Authentication Needed"...
As for permissions, I am not sure about the "user get" but I did give it access to the profiles and enabled all the anonymous permissions for services... still no luck...
Comment #16
kylebrowning commentedAdminister users
Give that perm to anonymous, when i turn that off, I get the same error, when i turn it back on it works.
Comment #17
pumpkinkid commentedDisregarding not feeling comfortable on a live app leaving Administer Users enabled for anonymous... I'm sorry to say that still did not fix it for me...
Comment #18
kylebrowning commentedIm not saying you need to do that for a live app. Im jsut trying to show you that its a permissions issue. If you want to make authenticated calls, thats easy to do, just login with a user that has that permission.
Heres a video showing it working, im not sure what else to say unless you expose your API so that I can make calls to it and try and debug the issue.
http://vimeo.com/22042580
Comment #19
pumpkinkid commentedI see what you mean... Ok... well other than the api.. is it possible that my settings on the app are bad?
Comment #20
kylebrowning commentedAuthentication needed means your call is not passing permissions, So the calls to the API are working, you just need to figure out why it doesnt think you're authenticated. and no, the code in my app, all I changed was the Domain URL.
Heres my endpoint export
Comment #21
pumpkinkid commentedOk... I imported your enpoint and it still says the same thing....
So how would we troubleshoot the authentication issue?
Comment #22
kylebrowning commentedAre you able to login with user.login?
Comment #23
pumpkinkid commentedI'm assuming you meant user/login... if so then yes... I just tried it again...
Comment #24
kylebrowning commentedOk so when you login, and then try to do a node get, what happens? Does that user have the Access Content permission?
Comment #25
pumpkinkid commentedRight now the only user is user 1 so yes...
Comment #26
kylebrowning commentedSo what happens when you do a node get?
Comment #27
pumpkinkid commentedThe app just says the same thing... "Authentication Needed"...
Thing is, even not logged in to Drupal, I can see node 1...
Comment #28
kylebrowning commentedNot sure what to tell you. If you get the server up somewhere that I can point my App to it, I can see if its your server, or the app. But as it stands right now, its working for me, as you can clearly see in the video.
Comment #29
pumpkinkid commentedOk, Well I'll let it be for today... Its almost quitting time, but I'll put it on an external site and give you access to it... nothing on it as you may have guessed, just trying to get that sample working.... lol
Thanks for all your help so far, I really appreciate it!
Comment #30
pumpkinkid commentedHave you by any chance tried using ips before? Wondering if that's the problem...
Comment #31
pumpkinkid commentedNevermind, just set up my host file to work for www.internal.com and I'm still getting the error...
Comment #32
pumpkinkid commentedI kept looking and couldn't seen anything wrong on the Drupal end... so to be safe I completely deleted all my downloads and used your two links...
Not sure why... but it works now... thanks!
Comment #33
kylebrowning commentedComment #34
robotcake commentedI also have the same error: authentication needed, and I have donwloaded the most updated services and plist support, not sure why it happens... I can get node 1 without logging in as well.
Comment #35
Kunani commentedSame here. latest versions including the dev of services. Response status is a 401 Unauthorized: Missing required argument username. Other includes an ASIHTTP requesterrordomain code=3 "Authentication needed"
Communication with Drupal end seems to work with unauthenticated requests (requesting nodes).
Comment #36
Kunani commentedOkay found the error. Its actually in the DIOSuser.m file of the drupal-ios-sdk.
Inside loginWithUsername: the forKey:@"name" and forKey:@"pass" should be changed to "username" and "password" as shown below:
- (NSDictionary *) loginWithUsername:(NSString*)userName andPassword:(NSString*)password {
[self setMethod:@"user.login"];
[self setMethodUrl:@"user/login"];
[self addParam:userName forKey:@"username"];
[self addParam:password forKey:@"password"];
[self runMethod];
return [self connResult];
}
Hope this helps someone.
Also on a side note the ios-sdk project page looks like a typo, it says to updated DIOSConnect.h file with API keys and domain updates but its the DIOSConfig.h file
Comment #37
kylebrowning commentedKunani, im not sure which version of the DRupal iOS SDK you are using, but in all the latest branches, its using username and password not name or pass, are you sure you have the latest code? This was fixed on Feb 7th, https://github.com/workhabitinc/drupal-ios-sdk/commit/139454fd8d1632ad9e...
Comment #38
robotcake commentedYes I think we all have downloaded the tree with @"user/login" error, actually github offer 7.x-3.x-1.0b download in https://github.com/workhabitinc/drupal-ios-sdk/tree/ but that is really outdated (10 Nov 2010), I will try download the updated one in https://github.com/workhabitinc/drupal-ios-sdk/tree/7.x-3.x and see what will happen, thanks Kunani and kylebrowning!!
Comment #39
kylebrowning commentedAhh Robotcake, thanks for pointing me to that, I forgot i tagged those releases. Release 1.1b is out!
Comment #40
MD3 commentedJust so that everyone knows, Kyle has reorganized the git repo so, there are no longer 7.x-3x or 6.x-3.x etc. The latest version is here:
https://github.com/workhabitinc/drupal-ios-sdk/tree/
Comment #41
MD3 commentedComment #42
MD3 commentedDid not mean to update title!