|
|
|
|
oDriveConnect (Function) In french: oDriveConnecte Creates a connection to OneDrive.
oOAuth2Param is OAuth2Parameters
oOAuth2Param.ClientID = "client_id"
oOAuth2Param.ClientSecret = "client_secret"
oOAuth2Param.RedirectionURL = "http://localhost:9000/"
oDrive is Drive
oDrive = oDriveConnect(oOAuth2Param)
OAuth2Param is OAuth2Parameters
OAuth2Param.ClientID = EDT_Client_ID
OAuth2Param.ClientSecret = EDT_Secret_code
sTenant is string = "cb8c2ded-f328-4948-9f3d-b2efa5e59138"
OAuth2Param.RedirectionURL = EDT_RedirectionURL
OAuth2Param.AuthURL = "https://login.microsoftonline.com/[%sTenant%]/oauth2/v2.0/authorize"
OAuth2Param.TokenURL = "https://login.microsoftonline.com/[%sTenant%]/oauth2/v2.0/token"
OAuth2Param.Scope = "offline_access Files.ReadWrite.All"
OAuth2Param.RedirectionURL = "http://localhost:3400/"
authToken is AuthToken = AuthIdentify(OAuth2Param)
IF ErrorOccurred THEN
Error("Unable to log in", ErrorInfo())
RETURN
END
gMyDrive = oDriveConnect(authToken)
<END>
IF ErrorOccurred THEN
Error("Unable to log in", ErrorInfo())
RETURN
END
Syntax
Authenticating to OneDrive using the OAuth 2.0 protocol Hide the details
<Result> = oDriveConnect(<Authentication parameters>)
<Result>: Drive variable Drive variable that contains all the OneDrive connection information. If an error occurs, the ErrorOccurred variable is set to True and an invalid variable is returned. <Authentication parameters>: OAuth2Parameters variable Name of the OAuth2Parameters variable that contains the authentication parameters:- The ClientID and ClientSecret properties must be specified.
- The RedirectionURL property can be specified. By default, this property is set to "http://localhost:3400/".
Authenticating to OneDrive using a token (refresh token) Hide the details
<Result> = oDriveConnect(<Authentication parameters>)
<Result>: Drive variable Drive variable that contains all the OneDrive connection information. If an error occurs, the ErrorOccurred variable is set to True and an invalid variable is returned. <Authentication parameters>: AuthToken variable Name of the AuthToken variable that contains the authentication parameters. Remarks It is recommended to to pass a token with a refresh token so that users do not have to log in each time the application is launched. If necessary, the token will be automatically updated. Information needed to connect to a drive using an existing token:
| | Properties of the OAuth2Parameters variable | Value used by the oDriveConnect function |
---|
AuthURL | "https://login.microsoftonline.com/common/oauth2/v2.0/authorize" | TokenURL | "https://login.microsoftonline.com/common/oauth2/v2.0/token" | Scope | "offline_access Files.ReadWrite.All" | RedirectionURL (Editable) | "http://localhost:3400/" |
Related Examples:
|
Unit examples (WINDEV): Drive functions
[ + ] This example illustrates the use of Drive functions (Google Drive, Dropbox, OneDrive).
|
|
Unit examples (WINDEV Mobile): Drive functions
[ + ] This example illustrates the use of Drive functions (Google Drive, Dropbox, OneDrive).
|
Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|