Step 2: Add Authentication
Users may insist on keeping their data on-premise due to security concerns with cloud-accessible content. Such users may balk at the idea of creating a reverse proxy that exposes this local data to anyone with the generated endpoint. In this case, we highly recommend adding authentication to your reverse proxy endpoint to ensure that only authorized users have access to the data it exposes.
Follow these steps to learn how, first with Basic Authentication and then with OAuth 2.0, both of which you can set up with a free ngrok account.
Add Basic Auth to Your ngrok Endpoint
Following these steps, run the following command in your terminal:
- Replace
1234
with the port associated with the data you’d like to pull - Replace
username
with the username you’d like to use Replace
password
with your passwordngrok http 1234 --basic-auth 'username:password'
- Replace
In Yext, create a Pull From API connector (follow the Create a Pull Connector guide for a refresher).
In the Request URL field, input the Forwarding URL that ngrok created for you. It should look something like
https://a1b2-34-56-78-90.ngrok.io
.Under Authentication, add Basic Auth and input the username and password you selected in the first step.
Click Pull in the upper right corner and click View Raw Response to see your on-premise content.
Add OAuth 2.0 to Your ngrok Endpoint
Following these steps, run the following command in your terminal:
- Replace
1234
with the port associated with the data you’d like to pull. You can replace
google
with eithermicrosoft
orgithub
if you would prefer to create a secure connection using one of those sites.ngrok http 1234 --oauth=google
- Replace
In Yext, create a new Linked Account (under Content > Configuration > Linked Accounts) with the site that you specified in the command prompt in the previous step.
Create a Pull From API connector (follow the Create a Pull Connector guide for a refresher).
In the Request URL field, input the Forwarding URL that ngrok created for you. It should look something like
https://a1b2-34-56-78-90.ngrok.io
.Under Authentication, add OAuth and select the Linked Account that you created in step 2.
Click Pull in the upper right corner and click View Raw Response to see your on-premise content.