Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ianjohngraham/xconnect-odata-proxy
A simple node.js proxy to access xConnect's oData API
https://github.com/ianjohngraham/xconnect-odata-proxy
Last synced: about 1 month ago
JSON representation
A simple node.js proxy to access xConnect's oData API
- Host: GitHub
- URL: https://github.com/ianjohngraham/xconnect-odata-proxy
- Owner: ianjohngraham
- Created: 2017-11-15T19:57:52.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-17T15:02:04.000Z (about 7 years ago)
- Last Synced: 2024-03-16T00:11:30.139Z (9 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- Awesome-Sitecore - xconnect-odata-proxy - A simple Node.js proxy to access xConnect's oData API in Sitecore 9. (xConnect and xDB)
README
# xconnect-odata-proxy
A simple node.js proxy to access xConnect's oData API in Sitecore 9The oData API in xConnect requires client certificate authentication.
This becomes an issue if you want external systems that dont support client cert authentication to use the tool.
The proxy handles the authentication for you by loading in data from .key and .pem files.## Creating your key and certs
* Download OpenSSL - https://www.openssl.org/source/
* Find you client certificate in IIS under Server Certificates and export it to a .pfx file.
* Run the following commands in Open SSL:openssl pkcs12 -in YourClientCert.pfx -nocerts -out key.pem -nodes
openssl pkcs12 -in YourClientCert.pfx -nokeys -out cert.pem
openssl rsa -in key.pem -out server.key* Find the certificate used for the TLS communication on your xConnect site (not the client certificate).
Export it to a .pfx file.* Run the following command in OpenSSL on the .pfx file:
openssl pkcs12 -in YourSiteCert.pfx -nokeys -out sitecert.pemThis certificate is required to allow Node.js to use TLS.
If you dont supply this you'll get the error: "Unable to verify first certificate"# Configuring
Change the variables at the top of the script accordingly:
```
var xConnectHost = 'xp0.xconnect'; - the host name of your xConnect instance
var proxyHost = 'localhost'; - the host anem of your proxy server
var proxyPort = '5060'; - the port you want it to run on
var keyFile = 'server.key'; - The key file you created
var clientCertFile = 'cert.pem'; - The client cert
var siteCertFile = 'sitecert.pem'; - The site's certificate```
# Running the proxy
* Clone this repo to your local machine .
* Open a Node.js command prompt and cd to the repo directory
* Install the modules
```
node npm-install
```
* Run the script```
node xconect-odata-proxy
```
* Test your oData API: http://yourhost:port/oData/# Troubleshooting
* If you get the error "unable to verify first certificate" then theres something wrong with your site certifcate.
* Make sure your certificates are in the Trusted Root Authorities store on the local computer.
* If all else fails you may have this issue with IIS not trusting your certificates.
https://stackoverflow.com/questions/27232340/iis-8-5-mutual-certificates-authentication-fails-with-error-403-16
In which case you may need to add a ClientAuthTrustMode registry setting.