REST API when LDAP enabled

Hi,

I've foreman 0.4.2-0.1 (from RPM)

REST API is working me fine when trying to pull facts from a server.

Now, if put LDAP Auth (:ldap: true) in place the API is not responding any
more due to Access Error:

curl -H "Content-Type:application/json" -H "Accept:application/json"
http://foreman.tonyskapunk.net:3000/hosts/foreman.tonyskapunk.net/facts
HTTP Basic: Access denied.

I've tried adding "facts view" in the Anonymous role but still receiving
the same Access denied error.

Any thoughts? should I file an issue if this is not the expected behaviour?

Thanks

··· -- Tony http://blog.tonyskapunk.net

You would need to pass in the login credentials. The credentials may be required regardless of the user be anonymous. Try passing in a username/password combo in the header.

Corey Osman
corey@logicminds.biz

Green IT and Datacenter Automation Specialist

··· On Mar 21, 2012, at 4:10 PM, Tony G. wrote:

Hi,

I’ve foreman 0.4.2-0.1 (from RPM)

REST API is working me fine when trying to pull facts from a server.

Now, if put LDAP Auth (:ldap: true) in place the API is not responding any more due to Access Error:

curl -H “Content-Type:application/json” -H “Accept:application/json” http://foreman.tonyskapunk.net:3000/hosts/foreman.tonyskapunk.net/facts
HTTP Basic: Access denied.

I’ve tried adding “facts view” in the Anonymous role but still receiving the same Access denied error.

Any thoughts? should I file an issue if this is not the expected behaviour?

Thanks


Tony
http://blog.tonyskapunk.net


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.

Hi Corey,

That did the trick, Thanks!

curl --user tonyskapunk:mysupersecretpassword -H
"Content-Type:application/json" -H "Accept:application/json"
http://foreman.tonyskapunk.net:3000/hosts/foreman.tonyskapunk.net/facts
– chop –

And I got all the facts

Thanks.

··· On Wed, Mar 21, 2012 at 5:34 PM, Corey Osman wrote:

You would need to pass in the login credentials. The credentials may be
required regardless of the user be anonymous. Try passing in a
username/password combo in the header.

Corey Osman
corey@logicminds.biz

Green IT and Datacenter Automation Specialist

On Mar 21, 2012, at 4:10 PM, Tony G. wrote:

Hi,

I’ve foreman 0.4.2-0.1 (from RPM)

REST API is working me fine when trying to pull facts from a server.

Now, if put LDAP Auth (:ldap: true) in place the API is not responding any
more due to Access Error:

curl -H “Content-Type:application/json” -H "Accept:application/json"
http://foreman.tonyskapunk.net:3000/hosts/foreman.tonyskapunk.net/facts
HTTP Basic: Access denied.

I’ve tried adding “facts view” in the Anonymous role but still receiving
the same Access denied error.

Any thoughts? should I file an issue if this is not the expected behaviour?

Thanks


Tony
http://blog.tonyskapunk.net


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.


Tony
http://blog.tonyskapunk.net