Module, Plugin

Developer
Supported

Rest

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Phil Sturgeon

     

You must be logged in to post.

HTTP authentication

Feature Request

timmo26
timmo26

Is HTTP authentication supported in rest?  If not could it be included?

philsturgeon
# 1
Developer
philsturgeon

You should be able to simply do this:

https://username:password@example.com/

timmo26
# 2
timmo26

It works on a browser if I use that format no worries, it won’t work within Rest though.  I am using the below code:

{exp:rest url=“https://user@userdomain.com:password@domain.com” verb=“get” format=“json”}
Name: {handle}<br>
{/exp:rest}

There are no results returned at all (there should be plenty).

Any ideas?

timmo26
# 3
timmo26
timmo26 - 20 February 2012 07:51 AM

It works on a browser if I use that format no worries, it won’t work within Rest though.  I am using the below code:

{exp:rest url=“https://user@userdomain.com:password@domain.com” verb=“get” format=“json”}
Name: {handle}<br>
{/exp:rest}

There are no results returned at all (there should be plenty).

Any ideas?

Also just tried on a live site instead of my local development site, same results…being no results.

timmo26
# 4
timmo26

Phil - any chance you’ve been able to look at this as yet?

timmo26
# 5
timmo26

*bump*

philsturgeon
# 6
Developer
philsturgeon

In this case it looks like a no then. It will need special HTTP Header to be sent with a lot of MD5 encryption of hashes and the like. I’ll try and get this nailed for v2.0 as I have written the code for PyroCMS I just need to port it over for you guys.

timmo26
# 7
timmo26

Sounds awesome.  When is v2.0 due out?  Am just a little keen to get this working :) haha.

philsturgeon
# 8
Developer
philsturgeon

Probably not as soon as you would like.

Do you have control over this API? If so, dont use emails. If not then… well it is outside the scope of what this module was set up for. The description does say “Open API’s” which mean - no passwords :)

timmo26
# 9
timmo26

I was just replying to another post (http://devot-ee.com/add-ons/support/rest/viewthread/3376) and realised I never got back to you on the not using emails.  I did try as you suggested so:

{exp:rest url=“https://apiuser:apiuserpass@domain.com” verb=“get” format=“json”}
Name{handle}<br>
{/exp:rest} 

Still no joy though.  Any work on v2.0 done in the past 6 months?

 

philsturgeon
# 10
Developer
philsturgeon

HTTP Basic Auth should work like that, if it doesn’t it must be a weird bug of some description.

2.0 is not coming sadly, as I just don’t have the time anymore. I have open-sourced the code which I am sure a few previous paying customers will be annoyed about - but the hope here is that the community can help to improve it.

I’ll be merging pull requests and trying to fix bugs, but I am not using EE for anything and trying to maintain addons for a system I don’t use is pretty tough.

philsturgeon
# 11
Developer
philsturgeon

Oops, link

https://github.com/philsturgeon/ee2-rest