Struggling with authorization

20 views
Skip to first unread message

walfish3d

unread,
Nov 27, 2010, 6:24:31 PM11/27/10
to junaio Augmented Reality platform - Developers
Hello guys,

this topic probably bores you to death, but I just can't get the
authorization to work properly. So i'm still trying to get tutorial 1
to work.

First of all I need to say that I was (and still am a bit) confused
about the zend framework, what is it? What do we need it for? And how
does the file structure look like when set up correctly? <projectroot>/
library/Zend/<dir "Acl" to ... "view.php"> is that correct?

Anyway I just can't get over step 2, I always end up with: 401 -
Unauthorized. I checked my API key around 1000 times and the only way
of getting through authorization is if i turn it off completly like
suggested in the trouble shooting section for tutorial 1, but thats
not a good solution in my opinion.
By editing the junaio.class.php I found out that the first validation
returns false so I don't even get over this code section:
// Check if authorization header is there
if (!isset($_HEADERS['Authorization'])) {
return FALSE;
}

I also tried adding the ?path= to my callback url but that didnt
change anything.

Any advise?

Mansour Raad

unread,
Nov 27, 2010, 6:30:10 PM11/27/10
to junaio-d...@googlegroups.com
Did u download the Zend Framework ? make sure to copy the Zend folder under ur project 'library' folder

Mansour
:-)

my blog: http://thunderheadxpler.blogspot.com
my tweets: mraad

rlonau

unread,
Nov 28, 2010, 5:10:37 AM11/28/10
to junaio Augmented Reality platform - Developers
Hey walfish3d,

i had the same problem with the projects hosted on a 1und1 server in
germany.

First of all, you don't need the Zend Framework for the basics
example. Try it without Zend.

For me authorization never worked. I made some output and saw that the
"HTTP_AUTHORIZATION" wasn't send.
Instead on the 1und1 server the variable is called
"REDIRECT_HTTP_AUTHORIZATION".
To geht the correct value you can try to add the following lines to
the
"library/junaio.class.php" file:

After line 71 enter these lines.
elseif (substr($name, 0, 14) == 'REDIRECT_HTTP_')
{
$headers[str_replace(' ', '-',
ucwords(strtolower(str_replace('_', ' ', substr($name, 14)))))] =
$value;
}

If it doesn't work, make some output to see if the
"HTTP_AUTHORIZATION" or a similar variable exists .
Hope this helps.

Greetings,
Rainer

walfish3d

unread,
Nov 28, 2010, 6:03:47 AM11/28/10
to junaio Augmented Reality platform - Developers
Thanks for your response! Sounds promising, I will try that and keep
you informed.

I'm currently using 'hetzner' as my project-host.

walfish3d

unread,
Nov 28, 2010, 9:03:30 AM11/28/10
to junaio Augmented Reality platform - Developers
Thanks again for that code, authorization works perfectly fine now!

Happy sunday to all of you! :)
Reply all
Reply to author
Forward
0 new messages