Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SharePoint Authorization integration can not authorize with Client Credentials #1602

Open
KaiFroehlich opened this issue Jul 11, 2024 · 1 comment
Labels
Follow Up The issue has an open question and must be followed up on Integration GitHub request for Integration area

Comments

@KaiFroehlich
Copy link

Please include the following with each issue:

1. Describe the bug
After using codeunit 9142 "SharePoint Auth." to initialize my Codeunit "SharePoint Client" with ClientCredentials (AadTenantId, ClientId, Certificate, CertificatePassword & Scope), when using said SharePoint Client to connect to SharePoint, a .NET error is thrown:
"A call to Microsoft.Dynamics.Nav.Runtime.ALAzureAdCodeGrantFlow.ALAcquireApplicationTokensWithCertificate failed with this message: The specified network password is not correct."
All Input Parameters have been checked, and the Client has full delegated and application site access to SharePoint:
image

2. To Reproduce
Steps to reproduce the behavior:

  1. Create a Application Registration in Entra with Access Rights to SharePoint and a Certificate to authenticate against it
  2. Try to initialize a SharePoint Client for a given SharePoint Site of the tenant with the resulting ClientId, CertificateText and CertificateSecret
  3. Try to use the SharePoint Client to do anything in SharePoint
    local procedure CreateTestFolder()
    var
        SharePointAuth: Codeunit "SharePoint Auth.";
        SharePointClient: Codeunit "SharePoint Client";
        TempSharepointFolder: Record "SharePoint Folder" temporary;
    begin
        SharePointClient.Initialize(SiteURL, SharePointAuth.CreateClientCredentials(TenantId, ClientId, CertificateText, CertificateSecret, Scope));
        SharepointClient.CreateFolder(FolderPath, TempSharepointFolder);
    end;

3. Expected behavior
Authorization against SharePoint is granted, in case of CreateTestFolder(), the desired folder is created in the SharePoint Site

4. Actual behavior
When trying to use the SharePoint Client (for example, to create a folder), a .NET error is thrown:
"A call to Microsoft.Dynamics.Nav.Runtime.ALAzureAdCodeGrantFlow.ALAcquireApplicationTokensWithCertificate failed with this message: The specified network password is not correct."

5. Versions:

  • AL Language: v14.0.1070882 (pre-release)
  • Business Central: DE Business Central 24.2 (Platform 24.0.21596.0 + Application 24.2.20227.20460)
  • List of Visual Studio Code extensions that you have installed: -
@kalberes kalberes transferred this issue from microsoft/AL Jul 19, 2024
@JesperSchulz
Copy link
Contributor

@KaiFroehlich, your issue was transferred here to BCApps, where you can create PRs to address the issues you've found yourself. Is that something you'd be interested in, or do you want Microsoft to look into the issue for you? In that case, you need to create a support case.

@JesperSchulz JesperSchulz added the Follow Up The issue has an open question and must be followed up on label Aug 26, 2024
@JesperSchulz JesperSchulz added the Integration GitHub request for Integration area label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Follow Up The issue has an open question and must be followed up on Integration GitHub request for Integration area
Projects
None yet
Development

No branches or pull requests

2 participants