none
Authentication using CSOM with Project Online RRS feed

  • Question

  • How are we to connect to Project Online with CSOM? All the SDK articles do not include any type of authentication. So if we are trying to use the CSOM to list out projects, and I try to create a credentials object and pass that to the ProjectContext.Credentials, how would this work with the Project Online solution? 

    If I try to use the standard network credentials, I get "(403) Forbidden" when I pass in my onmicrosoft.com account and password for credentials. I am the admin on my instance.

    So a little help on understanding how to connect remotely to Project Online via CSOM would be great.

    Here is a sample PowerShell script I am using. Same result in C# too:

    Add-Type -Path 'C:\Sync\Microsoft EPM\Scripts\Microsoft.ProjectServer.Client.dll'
    
    $credentials = Get-Credential "kirk@bossnunyatest.onmicrosoft.com"
    $pwaPath = "https://bossnunyatest.sharepoint.com/sites/pwa"
    
    $projContext = New-Object Microsoft.ProjectServer.Client.ProjectContext($pwapath)
    $projContext.Credentials = $credentials
        
        
    $projContext.Load($projContext.Projects)
    $projContext.ExecuteQuery()
    
    #Receive (403): Forbidden although I am admin
    
    #This works fine against OnPrem
    $projContext.Projects|select Id,Name
    

    Thanks,

    Kirk

    Monday, November 26, 2012 4:55 PM

Answers

All replies