Skip to content

Commit 7357bce

Browse files
committed
Updated readme
1 parent 0f90b3c commit 7357bce

File tree

2 files changed

+38
-8
lines changed

2 files changed

+38
-8
lines changed

azure-pipeline - Crm.Hubspot.OAuthProxy.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ variables:
88
projectName: 'Umbraco.Forms.Integrations.Crm.Hubspot.OAuthProxy'
99
project: 'src/$(projectName)/$(projectName).csproj'
1010
buildConfiguration: 'Release'
11+
azureServiceConnection: ''
12+
webAppName: 'umbraco-forms-hubspot'
1113

1214
steps:
1315
- script: dotnet build $(project) --configuration $(buildConfiguration)
@@ -17,11 +19,10 @@ steps:
1719
inputs:
1820
command: 'publish'
1921
projects: $(project)
20-
publishWebProjects: false
21-
#- task: AzureWebApp@1
22-
# displayName: 'Deploy Web App'
23-
# inputs:
24-
# azureSubscription: '<Azure service connection>'
25-
# appType: 'webAppLinux'
26-
# appName: '<Name of web app>'
27-
# package: '$(System.DefaultWorkingDirectory)/**/*.zip'
22+
publishWebProjects: true
23+
- task: AzureWebApp@1
24+
displayName: 'Deploy Web App'
25+
inputs:
26+
azureSubscription: $(azureServiceConnection)
27+
appName: $(webAppName)
28+
package: '$(System.DefaultWorkingDirectory)/**/*.zip'

src/Umbraco.Forms.Integrations.Crm.Hubspot/readme.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ Requires minimum versions of Umbraco:
1111

1212
## How To Use
1313

14+
### Authentication
15+
16+
The package supports two modes of authentication:
17+
18+
- API Key
19+
- OAuth
20+
21+
#### API Key
22+
1423
Log into your HubSpot account, go to _Settings > Integrations > API Key_ and create an API key.
1524

1625
Add this to a setting in `UmbracoForms.config`:
@@ -19,6 +28,26 @@ Add this to a setting in `UmbracoForms.config`:
1928
<setting key="HubSpotApiKey" value="[your API key]" />
2029
```
2130

31+
#### OAuth
32+
33+
The OAuth flow for authentication will be used if an API key is not configured.
34+
35+
When using the workflow, the user will be made aware that the installation is not authenticated with HubSpot and can't currently be used.
36+
37+
The will be prompted to click a link which will take them to the HubSpot authentication page for the Umbraco Forms HubSpot app.
38+
39+
They will need to log into their HubSpot account and agree to the permissions that the app requires (which is to be able to read and write contact information).
40+
41+
They will then be redirected to a website hosted at https://hubspot-forms-auth.umbraco.com which will present an authorization code issued by HubSpot. It's necessary to copy that and paste into the field indicated within the Umbraco Forms installation.
42+
43+
Behind the scenes this will make a further request to HubSpot which will return two tokens - an access token and a refresh token. The former will be provided in further API calls to HubSpot to authenticate the request. The latter will be stored via Umbraco's key/value service (which writes to the `umbracoKeyValue` table) and will be used to retrieve a new access token when it expires.
44+
45+
A button is available to clear the authentication with HubSpot, following which the authentication process would need to be repeated before the integration can again be used.
46+
47+
When the OAuth authentication method is being used, the API call to retrieve the token is proxied via and endpoint on the same website, allowing the Umbraco Forms HubSpot app secret key to remain secret (i.e. not included in configuration or hard-coded into the dll).
48+
49+
### Working With the HubSpot/Umbraco Forms Integration
50+
2251
Add the "Save Contact to Hubspot" workflow to a form and configure the mappings between the form and Hubspot fields.
2352

2453
![Select the HubSpot workflow](./img/select-workflow.png)

0 commit comments

Comments
 (0)