title: VCloud Director Org user authentication for RestAPI in python
body: <p>I have VMware setup for testing. I create one user abc/abc123 to access the Org url "http://localhost/cloud/org/MyOrg". I want to access the RestAPI of the VCloud. I tried with <strong>RestClient</strong> plugin in <strong>firefox</strong>. Its working fine. </p>
  
  <p>Now I tried with python code. </p>
  
  <pre><code>url = 'https://localhost/api/sessions/'
  req = urllib2.Request(url)
  base64string = base64.encodestring('%s:%s' % ('abc@MyOrg', 'abc123'))[:-1]
  authheader =  "Basic %s" % base64string
  req.add_header("Authorization", authheader)
  req.add_header("Accept", 'application/*+xml;version=1.5')
  
  f = urllib2.urlopen(req)
  data = f.read()
  print(data)
  </code></pre>
  
  <p>This is the code i get from stackoverflow. But for my example its give "urllib2.HTTPError: HTTP Error 403: Forbidden" Error.</p>
  
  <p>I also tried HTTP authentication for the same.</p>