Support for _simplified_ methods to authenticate against SharePoint
Now for user credentials flow, instead of
ctx_auth = AuthenticationContext(url=site_url)
ctx_auth.acquire_token_for_user(username,password):
ctx = ClientContext(site_url, ctx_auth)
an authenticated client could be initialized like this:
`ctx = ClientContext.connect_with_credentials(site_url, UserCredential(username,password))`
and for client credentials flow (aka [SharePoint App-Only](https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs)) instead of
ctx_auth = AuthenticationContext(url=site_url)
ctx_auth.acquire_token_for_app(client_id,client_secret):
ctx = ClientContext(site_url, ctx_auth)
like this:
`ctx = ClientContext.connect_with_credentials(site_url, ClientCredential(client_id,client_secret))`
Introduced support for provision modern Team & Communication sites (179)
- GroupSiteManager.create_group_ex - create a [Team site](https://support.office.com/en-us/article/create-a-team-site-in-sharepoint-ef10c1e7-15f3-42a3-98aa-b5972711777d)
- SPSiteManager.create - create a [Communication site](https://docs.microsoft.com/en-us/sharepoint/dev/apis/site-creation-rest)
Examples
Create a Team Site
client = ClientContext.connect_with_credentials(url,ClientCredential(client_id,client_secret))
site_manager = GroupSiteManager(client)
info = site_manager.create_group_ex("Team Site", "teamsite", True, None)
client.execute_query()
Create a Communication site
client = ClientContext.connect_with_credentials(url,ClientCredential(client_id,client_secret))
site_manager = SPSiteManager(client)
request = SPSiteCreationRequest("CommSite", "https://contoso.sharepoint.com/sites/commsite")
response = site_manager.create(request)
client.execute_query()
Bug fixes and feature requests
- 174 and 28 - a bug which prevented to authenticate successfully with user credentials on not root site collections or a sub sites
- 181 - missing types
- 178 - introduced support for provision modern Team & Communication sites