Skip to content

Commit e598382

Browse files
authored
Merge pull request #23 from umbraco/feature/ms-dynamics-auth
Dynamics service - proxy update
2 parents 1aca252 + fe512e0 commit e598382

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/Umbraco.Cms.Integrations.OAuthProxy/Configuration/AppSettings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public class AppSettings
1212

1313
public string GoogleClientSecret { get; set; }
1414

15+
public string DynamicsClientSecret { get; set; }
16+
1517
public string this[string propertyName] => (string)GetType().GetProperty(propertyName)?.GetValue(this, null);
1618
}
1719
}

src/Umbraco.Cms.Integrations.OAuthProxy/Configuration/ServiceConfiguration.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ public static class ServiceConfiguration
1010
/// <summary>
1111
/// Integrated services with their token URIs
1212
/// </summary>
13-
public static Dictionary<string, string> ServiceProviders = new Dictionary<string, string>
13+
public static Dictionary<string, string> ServiceProviders = new()
1414
{
1515
{ "Hubspot", "oauth/v1/token" },
1616
{ "HubspotForms", "oauth/v1/token" },
1717
{ "Semrush", "oauth2/access_token" },
1818
{ "Shopify", "oauth/access_token" },
19-
{ "Google", "token"}
19+
{ "Google", "token"},
20+
{ "Dynamics", "oauth2/v2.0/token" }
2021
};
2122

2223
public static void AddServiceClients(this IServiceCollection services)
@@ -41,6 +42,10 @@ public static void AddServiceClients(this IServiceCollection services)
4142
{
4243
c.BaseAddress = new Uri("https://oauth2.googleapis.com/");
4344
});
45+
services.AddHttpClient("DynamicsToken", c =>
46+
{
47+
c.BaseAddress = new Uri("https://login.microsoftonline.com/common/");
48+
});
4449
}
4550
}
4651
}

0 commit comments

Comments
 (0)