Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anonymous Calls working but not authenticated ones. #2

Open
etechuganda opened this issue Nov 22, 2012 · 4 comments
Open

Anonymous Calls working but not authenticated ones. #2

etechuganda opened this issue Nov 22, 2012 · 4 comments
Labels

Comments

@etechuganda
Copy link

root@erp:/python-glpi/pyglpi# python examples/list_computers.py
examples/list_computers.py:25: RuntimeWarning: GLPI environment variables not locally set
warnings.warn("GLPI environment variables not locally set", RuntimeWarning)
Enter your GLPI hostname: localhost
Enter your GLPI username: glpi
Enter your password:
True
cnrdv6iq932r8gah49l0b9g037 <=== Session ID would seem to indicate the login has succeded?
{u'faultCode': 13, u'faultString': u'Not authenticated'}
{u'faultCode': 13, u'faultString': u'Not authenticated'}
root@erp:
/python-glpi/pyglpi#

@mcphargus
Copy link
Owner

Not sure why this is happening. I'm getting the same results when trying to authenticate against localhost. I'm working on a fix, but for now, try using a fully qualified DNS name for your server's hostname.

EDIT: I can only confirm that this error occurs in the event of using localhost instead of: a fully qualified domain name with a working VirtualHost configuration in Apache.

@etechuganda
Copy link
Author

Also seems to be happening when I use the hostname.

Enter your GLPI hostname: erp.xxxxxxxx.com
Enter your GLPI username: glpi
Enter your password:
True
b1tubhbing2vi7ofcr56pigvv1
{u'faultCode': 13, u'faultString': u'Not authenticated'}
{u'faultCode': 13, u'faultString': u'Not authenticated'}
root@erp:~/python-glpi/pyglpi#

The only difference is I am not using a virtualHost config instead I changed the BASEURL to '/glpi'

@etechuganda
Copy link
Author

I copied some code from higher up in the GLPIClient.py which seems to work.

    request = urllib2.Request(self.url + urllib.urlencode(params))
    response = urllib2.urlopen(request).read()

    # response = urllib2.urlopen(self.__request__(params))

    return json.loads(response)

@mcphargus
Copy link
Owner

Strange. I'll do some more digging. I pulled the latest copy of this code onto a machine that didn't have it before and it worked for me freshouttathebox.

Like I said, I'll do more digging to see why this might not work on all installations, and I'll continue to assume you're working from the most recent commit to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants