Establishing a Connection
The objects available within our connector are accessible from the "cdata.onenote" module. In order to use the module's objects directly, the module must first be imported as below:
import cdata.onenote as mod
From there, the connect() method can be called from the connector object to establish a connection using an appropriate connection string, such as the below:
Authenticating to OneNote
OneNote uses the OAuth authentication standard. To authenticate using OAuth, you will need to create an app to obtain the OAuthClientId, OAuthClientSecret, and CallbackURL connection properties. See Using OAuth Authentication for an authentication guide.
Authenticating using Azure AD
Azure AD is a connection type that goes through OAuth. Set your AuthScheme to AzureAD and see Using OAuth Authentication for an authentication guide.
Authenticating using Azure Service Principal
Azure Service Principal is a connection type that goes through OAuth. Set your AuthScheme to AzureServicePrincipal and see Using Azure Service Principal Authentication for an authentication guide.
Authenticating using MSI Authentication
If you are running OneNote on an Azure VM, you can leverage Managed Service Identity (MSI) credentials to connect:
- AuthScheme: Set this to AzureMSI.
The MSI credentials will then be automatically obtained for authentication.