azure

  • 23 Oct

    How to access SharePoint Rest API using OAuth

    Version v2023 is needed and available here.

    Update: A newer and preferred OAuth2 setup is explained in the following blog article: link

    This Authorization method using OAuth2 was tested by a customer of us (Eddy, we really appreciate this). It is based on the following article.

    As mentioned in the article, first you’ll need to register an AD app with your AD Tenant. It will assign you the necessary information you need for the OAuth2 setup

    Feedback customer:

    • This required the following settings in Azure. Maybe only the delegated permissions under Graph are enough, didn’t play too much.

    Sharepoint OAuth2 authorization

    • Also the the redirect url should be set for the app, and ID_token must be enabled.

    Sharepoint OAuth2 authorization

    Limagito File Mover Setup:

    • In this case the Auth Type in our SharePoint setup should be set to: ‘OAuth 2.0 Authorization Code Flow’

    SharePoint OAuth Authentication

    • OAuth2 Setup:
      • Disable ‘Code Challenge’
        • Seems to work also when enabled (tested by customer)
      • Enable ‘Include Nonce’
      • Set ‘Authorization Endpoint URL’
        • https://login.microsoftonline.com/%realm/oauth2/authorize
        • %realm will be replaced by the Realm value (= Tenant or Tenant_ID). You can also enter the full URL including the Tenant.
      • Set ‘Token Endpoint URL’
        • https://login.windows.net/%realm/oauth2/token?api-version=1.0
        • %realm will be replaced by the Realm value (= Tenant or Tenant_ID). You can also enter the full URL including the Tenant.
      • Enter your Client ID and Client Secret (please check the article howto create them)
      • Set ‘Scope’ to:  openid
        • If you don’t receive a Refresh Token, change it to:  openid offline_access
        • Customer used: https://<Tenant>.sharepoint.com/.default
      • Set ‘Resource’ to:  https://graph.microsoft.com/
        • Customer used: https://<Tenant>.sharepoint.com
      • Set Response Mode to:  form_post
      • Set Response Type to:  id_token+code
      • When using %realm in the ‘Authorization or Token Endpoint URL’
        • Please set ‘Realm’ to your Tenant of Tenant_ID

    After the setup, please click on the <Get> button. If you get a firewall popup, you’ll need to accept this otherwise we will not be able to capture the Tokens.

    Follow the steps in the browser and it should fill the Refresh and Access Token afterwards. Do not forget to click <Save>.

    • OAuth2 setup  used by customer (info about the .default Scope: here):

    access SharePoint Rest API using OAuth

    • OAuth2 setup we received from our SharePoint source code provider:

    SharePoint OAuth Authentication

    • Common Setup:

    If you want extra debug information during the test, please enable ‘Add Control Information to Log’

    SharePoint OAuth Authentication

    #Filetransfer #SharePoint

    If you need any help with this ‘how-to-access-sharepoint-rest-api-using-oauth’ option, please let us know.

    Best Regards,

    Limagito Team

  • 07 May

    Q&A 9: copy file into Azure storage container folder in LimagitoX File Mover

    Q: We are setting up a new rule and need to copy/move a file into a Azure BLOB storage container but into a folder in that container.  How can we do that?

    A: Please add your ‘Container Name’ in the Azure Destination setup:

    LimagitoX-Azure-Container-Setup

    Please add your folder as in the following screenshot:

    • Screenshot shows folder setup with creation of subfolders (%SFS) found in Source:

    LimagitoX-Azure-Container-Folder-Setup

    • Screenshot shows folder setup without creation of subfolders found in Source:

    If you need help, please let us know.

    Regards,

    Limagito Team

    By Limagito-Team Azure Q&A , ,
  • 02 May

    How-To use AzCopy to download files in LimagitoX File Mover

    Regarding version 2020.5.2.0. On request we’ve added an option to use the Microsoft azCopy command-line utility within LimagitoX File Mover.

    Feedback from customer:

    We’ve very recently been pushed to implement as Azure-based file transfer workflow for our remote users thanks to the pandemic.  I’ve found that Limagito’s existing Azure file transfer performance seems to be on-par with the Microsoft Azure CLI tools (e.g. az storage blob <command>), but extremely slow compared to the multi-threaded Microsoft AzCopy utility.  On a 10gbps end-to-end link, the difference between Limagito/Azure CLI vs. AzCopy is on the order of 300mbps vs. 9gbps+.

    This utility is available: here

    There is a 32 and 64 bit version. Search for ‘download links here’. Download and unzip, you’ll need this later. The version we are using in this example is 10.4.3.

    In this example we’ll use Azure as Source. The goal is to download Block Blob Files. Normally you only need to enter the Account Name and Key but because we are going to use AzCopy you also need to enter the SAS URI.

    We’ll be searching for files in the container named ‘test’.

    The AzCopy option is available under the ‘Advanced’ tab.

    • Enable ‘Use AzCopy’
    • Set the directory where we can find the AzCopy commande-line utility (azcopy.exe)

    About the SAS URI. You can find this in your Azure Storage Accounts setup. Don’t forget to adjust the ‘Start and expiry date/time’.

    SAS-URI

    Click <Generate SAS> and search the result for SAS-token. This is the one we need for our Azure as Source setup. Copy the complete token and paste this in our ‘SAS Uri ( sv=.. )’ field.

    SAS-URI-Token

    Result in RunTime Log:

    By default, the AzCopy log files are located in the %USERPROFILE%\.azcopy directory on Windows.

    i.e. C:\Users\YourUsername\.azcopy

    AzCopy-Log

    At this moment this new option can help you to:

    • Download Block Bobs from Azure
    • Download Page Blobs from Azure
    • Upload Block Blobs to Azure
    • Upload Page Blobs to Azure (VHD and VHDX files only)

    If you need any help please let us know. This is just a start. We are convinced quite some extra features can be added to this new option. Please let us know what you think.

    Regards,

    Limagito Team

SEARCH