Skip to content

Commit 7aad1f5

Browse files
committed
Adiciona suporte à autenticação Azure AD
Inclui a biblioteca `Microsoft.Identity.Client` em `SPOUser.cs` para autenticação via Azure AD. Cria a classe `SharePointAuthConfig` para gerenciar configurações de autenticação do SharePoint. Ajusta `UserConfig.xml` para manter as informações de autenticação e atualiza `packages.config` para incluir a nova biblioteca.
1 parent 0efd3b4 commit 7aad1f5

3 files changed

Lines changed: 48 additions & 1 deletion

File tree

SPOtoSQL-Snapshots/ConsoleApp1/Sharepoint/SPOUser.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Microsoft.SharePoint.Client;
2+
using Microsoft.Identity.Client;
23
using System;
34
using System.Security;
45

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using System;
2+
3+
namespace Bring.Sharepoint
4+
{
5+
/// <summary>
6+
/// Configuration class for SharePoint authentication methods
7+
/// </summary>
8+
public class SharePointAuthConfig
9+
{
10+
/// <summary>
11+
/// Determines whether to use App Registration authentication
12+
/// </summary>
13+
public bool UseAppRegistration { get; set; }
14+
15+
/// <summary>
16+
/// Azure AD Application (client) ID
17+
/// </summary>
18+
public string ClientId { get; set; }
19+
20+
/// <summary>
21+
/// Azure AD Client Secret
22+
/// </summary>
23+
public string ClientSecret { get; set; }
24+
25+
/// <summary>
26+
/// Azure AD Tenant ID
27+
/// </summary>
28+
public string TenantId { get; set; }
29+
30+
/// <summary>
31+
/// SharePoint username for credential authentication
32+
/// </summary>
33+
public string Username { get; set; }
34+
35+
/// <summary>
36+
/// SharePoint password for credential authentication
37+
/// </summary>
38+
public string Password { get; set; }
39+
40+
/// <summary>
41+
/// SharePoint site URL
42+
/// </summary>
43+
public string SiteUrl { get; set; }
44+
}
45+
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Microsoft.SharePointOnline.CSOM" version="16.1.19814.12000" targetFramework="net48" />
3+
<package id="Microsoft.SharePointOnline.CSOM" version="16.1.19814.12000" targetFramework="net48" />
4+
<package id="Microsoft.Identity.Client" version="4.55.0" targetFramework="net48" />
45
</packages>

0 commit comments

Comments
 (0)