Skip to content

Commit c318c24

Browse files
authored
Merge pull request #7 from umbraco/feature/hubspot-forms-auth
Hubspot Forms service handlers.
2 parents 6d632e8 + 4bed6b3 commit c318c24

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ public class AppSettings
44
{
55
public string HubspotClientSecret { get; set; }
66

7+
public string HubspotFormsClientSecret { get; set; }
8+
79
public string SemrushClientSecret { get; set; }
810

911
public string this[string propertyName] => (string)GetType().GetProperty(propertyName)?.GetValue(this, null);

src/Umbraco.Cms.Integrations.OAuthProxy/Controllers/OAuthProxyController.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ public class OAuthProxyController : Controller
2222
/// <summary>
2323
/// Integrated services with their token URIs
2424
/// </summary>
25-
private static Dictionary<string, string> ValidServices = new Dictionary<string, string>
25+
private static Dictionary<string, string> ValidServices = new()
2626
{
27-
{ "Hubspot", "oauth/v1/token" }, { "Semrush", "oauth2/access_token" }
27+
{ "Hubspot", "oauth/v1/token" }, { "HubspotForms", "oauth/v1/token" }, { "Semrush", "oauth2/access_token" }
2828
};
2929

30-
//private static List<string> ValidServiceNames = new List<string> {"Hubspot", "Semrush"};
31-
3230
public OAuthProxyController(IHttpClientFactory httpClientFactory, IOptions<AppSettings> appSettings)
3331
{
3432
_httpClientFactory = httpClientFactory;

src/Umbraco.Cms.Integrations.OAuthProxy/Startup.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ public void ConfigureServices(IServiceCollection services)
2727
{
2828
c.BaseAddress = new Uri("https://api.hubapi.com/");
2929
});
30+
services.AddHttpClient("HubspotFormsToken", c =>
31+
{
32+
c.BaseAddress = new Uri("https://api.hubapi.com/");
33+
});
3034
services.AddHttpClient("SemrushToken", c =>
3135
{
3236
c.BaseAddress = new Uri("https://oauth.semrush.com/");

src/Umbraco.Cms.Integrations.OAuthProxy/appsettings.Development.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
},
1010
"AppSettings": {
1111
"HubspotClientSecret": "",
12+
"HubspotFormsClientSecret": "",
1213
"SemrushClientSecret": ""
1314
}
1415
}

0 commit comments

Comments
 (0)