!OneDrive integration
\\
It is Microsoft Graph REST API based integration.\\
__Proxy__: If your server's internet connection uses proxy server. You need to whitelist domains : login.microsoftonline.com, graph.microsoft.com\\
\\
You will start at the Microsoft azure portal:\\
[https://azure.microsoft.com/en-us/features/azure-portal/]\\
\\
__Application registration: __Go to the App registrations and click on New registration:\\
\\
Name it. Select the Microsoft account types. The redirect URL must end with register_microsoft_graph_api/. Then click on register.\\
\\
[attachments|register_app.png]\\
\\
Under the redirect URL configuration enable the __Access Token__ to be issued by the authorization endpoint:\\
\\
[attachments|SMTP Microsoft Graph XOAUTH 2 Integration/enable_access_token.png]\\
\\
__API permission:__ You must also provide permission for the Microsoft Graph. Go to the Api permission. Click on Add permission, and select Microsoft Graph. Choose Delegated permission and add the "Files.ReadWrite.All" permission:\\
\\
[attachments|permission_microsoft_graph.png]\\
\\
!!!1. OneDrive Business Type\\
\\
[attachments|ms_graph_app_permission.png]\\
__Client id : __ You can find it at Azure portal -> App Registration -> Overview:\\  
\\
[attachments|client_id.png]\\
\\
__Secret key :__ A new client secret needs to be created as well. Go to the "Certificate & secrets" and generate a new secret key. Click on New client secret:\\
\\
[attachments|new_secret.png]\\
[attachments|secret_value.png]\\
\\
__OneDrive remote item settings:__\\
\\
!!!2 Ondrive Personal Type\\
\\
__!!!Constraint:__ Microsoft Graph REST API does not support stream upload. In order to integrate with CrushFTP the files are temporarily stored as a local file (CrushFTP install folder/onedrive/) during the upload.\\
\\
[attachments|ms_graph_delegated.png]\\
\\
[attachments|permission_final.png]\\
\\
__Client id : __ You can find it at Azure portal -> App Registration -> Overview:\\  
\\
[attachments|client_id.png]\\
\\
__Secret key:__ A new client secret needs to be created as well. Go to the "Certificate & secrets" and generate a new secret key. Click on New client secret:\\
\\
[attachments|new_secret.png]\\
[attachments|secret_value.png]\\
\\
__OneDrive remote item settings:__\\
\\
__!!! The CrushFTP admin page URL must match the redirect URL.__ In our example: http://localhost:9090\\
\\
Select OneDrive item type click on "Get Refresh Token" button. Provide the Client ID, Client Secret, and Tenant (See your App registration -> Overview -> EndPoints): \\
\\
[attachments|remote_item_settings.png]\\
\\
Click on "OK" button, log in with your azure credentials, allow CrushFTP to have access to your OneDrive files. After that the form will disappear and the username and password will be filled. Done.\\
\\
[attachments|remote_item_done.png]\\
\\