question

Mikhail-6702 avatar image
0 Votes"
Mikhail-6702 asked ·

How to automate the connection to a SharePoint site with multi factor automation for Azure Development Pipiline

We are trying to organize an Azure Development Pipeline where the deployment and some development process would be automated.

The SharePoint sites we are currently working with require a multi-factor authentication, which mean the site access requires confirmation from either the phone up or the security code

Previously in the code the following connection logic used to work

  context.Credentials = new SharePointOnlineCredentials(
  ConfigSettings.AdminUserName,
  ConfigSettings.AdminPassword);

This code no longer works as this code cannot connect to the multi factor authentication sites and a different code is used to connect

 var authManager = new OfficeDevPnP.Core.AuthenticationManager();
 context = authManager.GetWebLoginClientContext(ConfigSettings.SiteUrl)

This code works well when the code is run manually. When this code is reached, the connection interface opens and the credentials are handled and confirmed.

But are the ways to automate the authentication process? Can the multi-factor authentication be fully automated using some sort of secure token?

Thank you in advance for your answers

azure-ad-multi-factor-authenticationazure-ad-authenticationazure-webapps-content-deployment
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

FrankHuMSFT-3200 avatar image
0 Votes"
FrankHuMSFT-3200 answered ·

Hello,

The multi factor authentication cannot be automated, as a large point of the multi factor is to provide secure authentication from a human that is logging in with multiple points of security from said human to prove their identity.

Perhaps you could utilize a different authentication protocol, such as providing the sharepoint server a service principal that has exclusive access to your azure development pipeline. If your azure dev pipeline is utilizing AAD OAuth2 you would be able to utilize the AAD Client Credential flow. https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-oauth2-client-creds-grant-flow

Note per the post below, for further help on this azure devops pipeline authentication question please open a developer community item with the tag [AltCreds] in the title. For faster service, please search for [AltCreds] in the developer community forum first, as your question might already be answered. You can reach out to us on Twitter at @AzureDevOps too. https://devblogs.microsoft.com/devops/azure-devops-will-no-longer-support-alternate-credentials-authentication/

Reference Links : https://developercommunity.visualstudio.com/spaces/8/index.html https://twitter.com/AzureDevOps

Please remember to mark one of the responses as answer if your question has been answered. If not please let us know if there are anymore questions.

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

oceanspecialists-5446 avatar image
0 Votes"
oceanspecialists-5446 answered ·

Thanks for such a precious Knowledge.

Please Visit: https://www.oceanspecialists.com

2822-2.jpg


2.jpg (165.6 KiB)
· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.