Help needed to Bypass MFA for App-Only authentication with Project Online (CSOM): Encountering 'User Not Found in Active Directory or Project DB' Error

Carl Duguay 0 Reputation points
2024-11-07T16:30:30.91+00:00

Issue

We are attempting to access Project Online data in Project Permission mode using app-only authentication, specifically to bypass MFA for programmatic access, as we aim for continuous, automated access without any user-interaction. We are using CSOM, using Microsoft.ProjectServer.Client.ProjectContext in .NET 4.8 to connect to Project Online. Despite following several documented approaches with client certificates, client secrets, and OAuth configurations, we keep encountering errors like 401 Unauthorized and User not found in Active Directory or in project db. Below is a summary of our steps. Despite multiple attempts, we consistently receive errors blocking access. We have followed recommended documentation for client credentials, certificates, and permissions but still face access issues.

Technology

  • Project Online
  • CSOM in .NET 4.8
  • Microsoft.ProjectServer.Client.ProjectContext
  • Azure AD (Entra ID)

Solutions Attempted

  • Client Certificate Authentication:
    • Configuration: Registered an app in Azure AD (Entra) with a client certificate and set permissions including Sites.FullControl.All. NOTE: we could not select Project permissions (Project.Read, etc.) in the Application Permissions screen, only within the delegated permissions screen.
    • Token Acquisition: We acquired an access token using az account get-access-token --resource=https://
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,274 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,230 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2024-11-07T16:30:30.9266667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    It seems you're facing challenges with app-only authentication for Project Online, particularly in bypassing MFA and accessing Project-specific data. Here are some insights based on your questions:

    1. App-Only Authentication in Project Online: Project Online does not natively support app-only authentication in Project Permission mode. The permissions required for Project Online (like Project.Read or Project.ReadWrite) are typically granted through delegated permissions, which necessitate user context and may not bypass MFA.
    2. Success with App-Only Credentials: There are limited documented cases of successfully applying app-only credentials for Project Online access, especially in Project Permission mode. Most implementations require user interaction or delegated permissions, which complicates automation without MFA.
    3. Alternative Permission Configurations:
      • Ensure that the app registration in Azure AD has the correct permissions set. While you mentioned using Sites.FullControl.All, Project-specific permissions are often not available for app-only scenarios.
      • Review Azure AD settings and conditional access policies that might restrict app access. Sometimes, policies may inadvertently block app-only access.
      • Consider using the Microsoft Graph API for broader access, but note that it may not cover Project-specific data as you've discovered.

    For your specific implementation, it may be beneficial to explore other authentication flows or configurations that align with your automation goals while adhering to the security requirements of Project Online.


    References:

    0 comments No comments

  2. Emily Du-MSFT 51,271 Reputation points Microsoft External Staff
    2024-11-11T02:16:07.3466667+00:00

    Project Online is currently not supported in the Q&A forum.

    Please start a new discussion via the Project Community so that you can get dedicated support on this issue.

    Thank you for your understanding.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.