Upgrading SharePoint apps from Azure Access Control service to Azure Active Directory

Microsoft Community Learning
30 Mar 202312:02

Summary

TLDRThis video script explains the transition from Access Control Services (ACS) to Azure Active Directory (Azure AD) for applications interacting with SharePoint Online. It demonstrates how to upgrade existing solutions, create a new Azure AD application, and authenticate using an X509 certificate, ultimately enabling granular permission control and modern development techniques.

Takeaways

  • πŸ˜€ Microsoft retired ECS (External Content Services) in November 2018, and it is recommended to upgrade to Azure Active Directory for new solutions.
  • πŸ”’ ACS is an old authentication model based on ADIN, which is outdated. Modern development should rely on Azure Active Directory for application registration.
  • πŸ“ˆ Azure Active Directory allows for granular selection of permissions, such as resource-specific permissions, for consuming SharePoint Online sites or content.
  • πŸ“ To upgrade from ACS to Azure AD, create a new Azure Active Directory application, generate an X509 certificate for authentication, and configure API permissions.
  • πŸ”„ Refactor code from using ACS client ID and secret to Azure AD Open Authorization and a client ID with a certificate.
  • πŸ“‘ Demonstrated how to register an application in Azure ACS through the SharePoint Online tenant page, obtaining a client ID, client secret, and configuring permissions.
  • πŸ’» Showed an example of a C# application using the PMP framework to interact with SharePoint Online, including reading a document library title and uploading a document.
  • πŸ”‘ Explained how to register a new application in Azure AD using PMP PowerShell, generating a self-signed certificate and associating it with the application.
  • πŸ“‹ Discussed how to grant permissions to the newly registered application in Azure AD, specifying the tenant and user credentials for authentication.
  • πŸ”— Provided a step-by-step guide on how to consume SharePoint Online using an Azure AD registered application, including reading a document library title and uploading a document.
  • πŸ”„ Highlighted the process of registering the application image and using the authentication manager with the certificate, client ID, and tenant ID to authenticate and interact with SharePoint Online.

Q & A

  • What is the primary reason for upgrading from Access Control Services (ACS) to Azure Active Directory (Azure AD)?

    -The primary reason for upgrading from ACS to Azure AD is that ACS is an older service based on an outdated development model. Microsoft retired ECS in November 2018 and recommends using Azure AD for new solutions and upgrading existing solutions to the newer model.

  • Why should new solutions not use Access Control Services (ACS)?

    -New solutions should not use ACS because it is an outdated authentication model that is no longer supported for new development. Azure AD provides a more modern and secure approach to application authentication and access control.

  • What is the role of an X509 certificate in the context of SharePoint Online and Azure AD?

    -An X509 certificate is used for app-only authentication with SharePoint Online. It is required to authenticate the application providing it with the necessary permissions to interact with SharePoint Online resources.

  • How can you create a new Azure AD application?

    -You can create a new Azure AD application by registering it in the Azure portal, providing details such as the application name, redirect URI, and other necessary configurations.

  • What permissions are needed for an application to consume SharePoint Online?

    -The application needs API permissions that allow it to access and manipulate SharePoint Online resources. These permissions can be configured during the application registration process in Azure AD.

  • How does the PMP framework help in developing applications that consume SharePoint Online?

    -The PMP framework provides a set of packages and tools that accelerate the development process of applications that consume SharePoint Online. It helps manage configuration settings and streamlines the authentication process.

  • What is the purpose of the app settings JSON file in the provided example?

    -The app settings JSON file in the example is used to store configuration settings for the application, such as the site URL, list ID, client ID, client secret, and other necessary details for connecting to SharePoint Online.

  • How can you upgrade an existing ACS-registered application to use Azure AD?

    -To upgrade an existing ACS-registered application to use Azure AD, you need to create a new Azure AD application, generate an X509 certificate for authentication, configure the necessary API permissions, and refactor your code to use Azure AD authentication instead of ACS.

  • What is the significance of the tenant ID in the context of Azure AD application registration?

    -The tenant ID is a unique identifier for the Azure AD tenant where the application is registered. It is used to associate the application with the correct Azure AD tenant and manage permissions and access control.

  • How does the authentication manager instance help in accessing SharePoint Online resources?

    -The authentication manager instance, created using the client ID, certificate, and tenant ID, facilitates the authentication process with Azure AD. It enables the application to obtain a client context that can be used to access and manipulate SharePoint Online resources.

Outlines

00:00

πŸ”’ Upgrading to Azure Active Directory

The first paragraph discusses the transition from Access Control Services (ACS) to Azure Active Directory (Azure AD) for application authentication. It explains that ACS is an outdated service retired by Microsoft in 2018 and recommends upgrading to Azure AD for new solutions. The paragraph outlines the process of creating a new Azure AD application, generating an x509 certificate for authentication, configuring API permissions, and refactoring code to use Azure AD's OAuth and client certificates. A demo is provided to illustrate how to interact with SharePoint Online using an application-only account.

05:02

πŸš€ Implementing Azure AD in SharePoint Online

The second paragraph demonstrates how to implement Azure AD in SharePoint Online. It shows how to register a new application in Azure AD using PMP PowerShell, generate an x509 certificate, and grant permissions to the application. The process involves creating a certificate, registering the application in Azure AD, and granting API permissions. The paragraph also includes a practical example of how to consume SharePoint Online using an application registered in Azure AD, highlighting the steps to read a document library's title and upload a document.

10:04

πŸ”— Final Steps for Azure AD Integration

The third paragraph focuses on the final steps to integrate Azure AD with SharePoint Online. It details how to use a certificate to authenticate against Azure AD, create an authentication manager instance, and access SharePoint Online resources. The paragraph provides a comprehensive example of how to read the title of a document library and upload a document using an Azure AD registered application. It concludes with instructions on how to register the application image and authenticate using the authentication manager with the client ID, certificate, and tenant ID.

Mindmap

Keywords

πŸ’‘Azure Active Directory

Azure Active Directory (Azure AD) is a cloud-based identity and access management service from Microsoft. It allows users to manage and secure access to applications and resources. In the video, Azure AD is recommended over the older Azure Access Control Services for registering applications with elevated permissions for SharePoint Online.

πŸ’‘Access Control Services

Azure Access Control Services (ACS) is an older Microsoft service for managing user identities and access permissions. The video explains that ACS has been retired and encourages upgrading to Azure AD due to its modern development techniques and better security features.

πŸ’‘SharePoint Online

SharePoint Online is a cloud-based service that helps organizations share and manage content, knowledge, and applications. The video focuses on how to create and upgrade applications that interact with SharePoint Online using Azure AD for authentication and permissions management.

πŸ’‘Application Only Account

An Application Only Account is used to authenticate and interact with services without relying on a specific user account. The video demonstrates creating a background application with elevated permissions using an application only account to access SharePoint Online.

πŸ’‘x509 Certificate

An x509 Certificate is a digital certificate that uses the x509 public key infrastructure standard to verify identities and secure communications. In the video, it is mentioned as a requirement for app-only authentication with SharePoint Online, ensuring secure communication between the application and the service.

πŸ’‘API Permissions

API Permissions are access rights granted to applications to interact with APIs. The video highlights the need to configure API permissions in Azure AD to allow applications to consume SharePoint Online resources, offering granular control over what the application can access and perform.

πŸ’‘Client ID and Client Secret

Client ID and Client Secret are credentials used by applications to authenticate with services. The video discusses moving from the old ACS model, which uses Client ID and Client Secret, to the new Azure AD model that leverages certificates for authentication.

πŸ’‘PNP Framework

The PNP Framework (Patterns and Practices Framework) is a set of tools and libraries that help developers work with Microsoft 365 services. In the video, the PNP Framework is used to simplify the development process when consuming SharePoint Online APIs in a .NET application.

πŸ’‘Authentication Manager

The Authentication Manager is a component that handles the authentication process for applications. The video illustrates how to use the Authentication Manager to authenticate with SharePoint Online using different methods, including ACS credentials and Azure AD with certificates.

πŸ’‘PowerShell

PowerShell is a task automation and configuration management framework from Microsoft. The video shows using PNP PowerShell commands to register a new application in Azure AD, generate certificates, and grant necessary permissions, streamlining the application setup process.

Highlights

Using an application-only account with Azure Active Directory for interacting with SharePoint Online.

Microsoft retired Azure Access Control Services (ACS) in November 2018, and it is recommended to upgrade to Azure Active Directory (AAD).

Azure ACS is based on an old authentication model for SharePoint, and modern development techniques should use Azure AD application registration.

Azure AD allows for granular selection of permissions through resource-specific consent or delegated permissions.

Upgrading from ACS to AAD involves creating a new Azure AD application and using an x509 certificate for authentication.

Configuration of API permissions is required to consume SharePoint Online with Azure AD.

Code refactoring is necessary to move from client ID and client secret in ACS to client ID with a certificate in Azure AD.

A demo is provided showing how to upgrade from ACS to Azure AD using a C# application.

Creating an Azure AD application can be done using PnP PowerShell with the Register-PnPAzureADApp cmdlet.

The cmdlet generates an x509 certificate, registers the application in Azure AD, and configures permissions.

The example application demonstrates reading the title of a document library and uploading a document to SharePoint Online using Azure AD.

The application reads settings from an appsettings.json file and uses the PnP framework for development.

Authentication in the upgraded application is done using the client ID, tenant ID, and the certificate's thumbprint.

The upgraded application achieves the same functionality as the old ACS-based application but with modern authentication methods.

Additional resources and links are provided for further learning about upgrading to Azure AD.

Transcripts

play00:00

foreign

play00:10

access control services to Azure active

play00:13

directory registered applications the

play00:15

use case for this scenario is when you

play00:18

want to create a demo or a background

play00:20

application which will interact with

play00:23

elevated permissions with SharePoint

play00:25

online and you will not use any specific

play00:29

user account but you want to use an

play00:31

application only account the options

play00:33

available nowadays to realize this kind

play00:36

of scenario are using a major access

play00:39

control services registered application

play00:41

in a specific Target tenant or an Azure

play00:44

active directory registered application

play00:46

so let me try to explain you why you

play00:49

should use Azure directory and in case

play00:52

you have an access control services

play00:54

register application you should upgrade

play00:56

it to Azure ID first of all Azure access

play01:00

control services is now what there is an

play01:02

old service based on an old development

play01:05

model in fact Microsoft retired ECS in

play01:09

November 2018. it is still available for

play01:13

SharePoint online but you should not use

play01:15

it anymore in new Solutions and you

play01:18

should upgrade your existing solutions

play01:20

to the new model which is the one based

play01:22

on Azure active directory moreover the

play01:25

Azure ACS is a model is an

play01:28

authentication model for application

play01:29

which is based on the Adin model of

play01:32

SharePoint which is now kind of an old

play01:35

model and nowadays you should rely on

play01:38

new modern development techniques and

play01:40

again one more time on Azure active

play01:42

directory application registration where

play01:45

for example you can also leverage the

play01:47

resource specific content or

play01:50

decide.selected permissions which allow

play01:52

you to have a really granular selection

play01:54

of permissions whenever you need to

play01:57

consume a SharePoint online site or

play01:59

content so how can you actually upgrade

play02:03

from ACS to AED well first of all you

play02:06

need to reduce history new Azure active

play02:08

directory application you need to create

play02:10

an x519 certificate for the

play02:12

authentication in fact SharePoint online

play02:15

for app only requires you to

play02:17

authenticate providing an x509

play02:19

certificate you have to configure the

play02:22

API permissions that you will need with

play02:25

your application in order to consume

play02:27

SharePoint online and then you will need

play02:28

to refactor a bit your code in order to

play02:31

move from the old school client ID and

play02:34

client secret and ACS to the new school

play02:37

of azure active directory open

play02:39

authorization and a client ID with a

play02:41

certificate so let me move to the demo

play02:44

environment and let me show you how you

play02:46

can do that in practice

play02:49

so imagine that we have an application

play02:52

that we already registered in Azure ACS

play02:55

the registration goes through the

play02:57

upright new page of your target

play02:59

SharePoint online tenant and you will

play03:02

get back a client ID a client secret and

play03:05

you have to provide the title an app

play03:07

domain and then a direct URI for your

play03:09

application once you've done that you

play03:12

can retrieve through the app inventory

play03:14

up in dot SPX page under digital point

play03:17

admin UI your application doing a lookup

play03:22

by client ID and you will be able to

play03:24

configure a custom set of permissions

play03:26

like you can see here right here when we

play03:29

provide an application permission of

play03:32

type full control to this application

play03:34

meaning that it will have access to all

play03:37

of the site collections in maintenance

play03:39

with full control rides and then we have

play03:42

a side collection this one from ACS 3ad

play03:45

apps in which I have a document Library

play03:48

the default one and I want to write an

play03:51

application to read the title of this

play03:53

document library and to upload the

play03:55

document into the document Library so we

play03:58

can do that using a c-sharp application

play04:02

for example here I have an application

play04:05

in which I'm using some packagings like

play04:09

the PMP framework for example to speed

play04:11

up the development process consuming

play04:14

SharePoint online and I'm using some

play04:17

other packages to manage the

play04:18

configuration setting of my application

play04:20

in fact my settings I will have this URL

play04:23

of the site that I want to consume the

play04:25

title of the list or library that I want

play04:27

to consume the client ID and the client

play04:29

secret of my application

play04:31

as such when I will execute my

play04:33

application which is about net 6

play04:35

application I will need to read the

play04:38

configuration from the app settings Json

play04:40

file I will translate the Json settings

play04:43

into a fully type object and then using

play04:46

a PMP framework I can create an

play04:48

authentication manager instance and I

play04:50

can do the get ACS upon the context the

play04:53

providing URL of the target side the

play04:56

client ID and the client secret I will

play04:59

get back a client context object of

play05:02

system of decline side of the model of

play05:04

SharePoint online and then using season

play05:06

I can get a list by title providing the

play05:09

title of my list I can do the load of

play05:13

the list including the title so that by

play05:15

executing the query asynchronously

play05:18

against the SharePoint online I will get

play05:21

back the title of my list I can create a

play05:24

random file content with random text

play05:27

inside of it and I can upload the file

play05:30

again as synchronously in the root

play05:32

folder of my target Library simply

play05:34

specifying a random file name based on a

play05:38

guide and that's it so this is a very

play05:40

simple example that we want to upgrade

play05:43

from ACS to Azure ID so if I will run

play05:47

this application even if it is a very

play05:50

simple one

play05:51

we can see that in a matter of few

play05:54

seconds we will have our console

play05:56

application running and we will get back

play05:59

the title of the target document library

play06:01

and the document will be created in the

play06:05

Target document library in fact if I

play06:06

refresh this Library we can see that now

play06:09

we have a new file that I just created

play06:11

simple as that now let's make the

play06:14

assumption that we want to upgrade the

play06:16

solution to Azure active directory we

play06:19

can easily register a new application in

play06:22

Azure ID simply relying on PMP power

play06:25

shell and specifically we can use the

play06:28

register PMP Azure ID app command letter

play06:30

providing the application name which

play06:33

will be the name of the application that

play06:34

will be registered in Azure ID we can

play06:37

provide this store where we want to save

play06:40

generated risk 509 certificate which

play06:43

will be created by the CMD LED and

play06:46

uploaded to Azure active directory and

play06:48

Associated to our application in nature

play06:50

active directory with have to specify

play06:52

the target tenant as you can see right

play06:55

here as well as the username and the

play06:58

password to access the target 10 and

play07:01

register the application and the

play07:02

password will be provided through a

play07:04

prompt to the user as well as we can

play07:06

specify a certificate password which

play07:08

will be used to protect the private key

play07:10

on the certificate and again here I'm

play07:13

using a prompt for the user and now I'm

play07:15

going to say the dot serum.pfx files

play07:18

Associated to the auto generated file of

play07:21

my certificate into the current part so

play07:24

by executing this CMD layer

play07:26

we will have to provide first of all the

play07:29

credentials of the user that want to use

play07:31

to register my application and then I

play07:34

will have to provide a password which

play07:36

should be strong enough secure enough to

play07:38

protect the private key of my

play07:40

certificate

play07:42

the CMD let will start creating the

play07:45

certificate and storing the certificate

play07:47

in the certificate store then it will

play07:50

create the application initial active

play07:52

directory and will wait up to 60 seconds

play07:55

for the app to be ready and then it will

play07:57

launch the web UI to Grant the

play08:00

permissions that will be automatically

play08:02

granted by the CMD led to the

play08:04

application created I don't want to

play08:07

waste your time so I will speed up the

play08:10

recording while waiting for the 60

play08:11

seconds

play08:13

and here we are now we will have a web

play08:17

prompt to Grant the permissions to our

play08:21

newly registered application

play08:24

first of all we need to pick a user

play08:27

account to use in order to do the grant

play08:30

of the permissions and we will have to

play08:32

provide a password for that users and

play08:35

once we have done that we will be able

play08:37

to Grant the permissions automatically

play08:40

added to the application registrations

play08:43

by the CMB LED if you like using

play08:46

additional Arguments for the CMD letter

play08:48

you can choose the permission that you

play08:50

want to Grant targeting either

play08:52

SharePoint online permissions or

play08:54

micrograph permissions right now I'm

play08:56

using default permissions I'm accepting

play08:58

to Grant those permissions to my app and

play09:01

in a matter of few seconds now we're

play09:03

ready the page is done don't care about

play09:06

this kind of response but now the

play09:08

application is registered and in fact if

play09:11

I will go to Azure active directory we

play09:13

can see that we have my application

play09:16

registered I can click on it and we can

play09:20

see

play09:21

yet we have an application with a

play09:22

specific client ID and directory ID we

play09:25

can click on the certificate and secret

play09:28

to see the certificate that has been

play09:30

generated automatically by the CMD let

play09:32

and if we go to API permissions we can

play09:34

see the permissions granted to the

play09:36

application as you can see right here so

play09:38

it is now time to consume one more time

play09:41

SharePoint online the same side

play09:43

collection as before but now using the

play09:45

Azure ID registered application the

play09:48

application is almost the same as before

play09:49

we still have an app settings.json file

play09:52

where we specify still the site URL the

play09:55

list ID the client ID and this time the

play09:57

tenant ID and the certificate thumb

play09:59

print which we can get back from the

play10:01

certificate that was generated then

play10:03

instead of

play10:04

using an instance of authentication

play10:07

manager to create the client context

play10:10

based on the ACs credentials we rather

play10:13

read the certificate that we want to use

play10:15

to authenticate against Azure active

play10:18

directory providing the Target store the

play10:21

store location and the thumbprint of the

play10:23

certificate which we can read from the

play10:26

settings of our application and then we

play10:28

create a new instance of the

play10:30

authentication manager using this

play10:31

Factory method which is create with

play10:33

certificate which will accept the client

play10:36

ID the certificate and the Tenant ID by

play10:39

doing that the authentication manager

play10:41

will allow us to invoke the get context

play10:43

method to still get a client context of

play10:46

season and since we have a client

play10:49

constant we can then do exactly what we

play10:51

did before in the previous sample and we

play10:53

can read the title of the document

play10:55

library and we can upload a document

play10:56

into the target document Library so at

play10:59

the very end we simply need to register

play11:01

the application image ready you can do

play11:03

that using the PNP power shares emulator

play11:05

or you can do it manually as you can

play11:07

read through the article Associated to

play11:09

this video and once you have got the

play11:12

application registered and the

play11:13

certificate created for you you can

play11:15

authenticate using the authentication

play11:17

manager providing that certificate the

play11:19

client ID and the Tenant ID you get the

play11:21

context and you are good to go that's

play11:23

the replacement you need to do to

play11:25

upgrade your solution just for the sake

play11:27

of completeness let me run this

play11:29

application as like as I did with the

play11:31

previous one so now we have yet another

play11:33

console application running we get

play11:36

the title of the library and we just

play11:38

uploaded a new document in the Target

play11:40

library in fact if we go back here and

play11:43

we refresh now we have two documents

play11:45

instead of one and the last one was

play11:47

created few seconds ago

play11:50

here you can find additional links if

play11:53

you want to dig into this topic and

play11:55

thanks for watching this video

play11:59

[Music]

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Azure ADAzure ACSapp upgradeSharePoint onlineauthenticationcertificatepermissionsmodern developmentAzure registrationcloud security