I have a problem connecting to DynamicsCRM2011 through Python using suds module. I am getting the following error:
suds.transport.TransportError: HTTP Error 401: Unauthorized
My current code:
from suds.transport.https import WindowsHttpAuthenticated
from suds.client import Client
import json, requests
from suds.wsse import *
url = 'https://crm.internal.website/internal.project/xrmservices/2011/OrganizationData.svc?WSDL'
security = Security()
token = UsernameToken('', '')
token.setnonce('MyNonceString')
token.setcreated(datetime.now())
security.tokens.append(token)
ntlm = WindowsHttpAuthenticated(username='', password='')
client = Client(url, transport=ntlm)
client.set_options(wsse=security)
During debugging I can see that I can't authenticate at the STS Microsoft Server.
Any help is appreciated. Can someone at least explain how the authentication process works with DynamicsCRM (2011)?
CRM 2011 oData endpoint doesn't support connections from outside the CRM application.
For CRM 2011 your only option is the SOAP endpoint.
Regarding the authentication, that is another problem, you should look at some PHP examples (also here on StackOverflow) that shows how to connect to CRM 2011
EDIT: here a Python example: http://jlattimer.blogspot.com.au/2015/08/soap-only-authentication-using-python.html