UNPKG

node-red-contrib-opentext

Version:

node-red-contrib-opentext - An Opentext Core client

100 lines (93 loc) 3.65 kB
<!-- Copyright JS Foundation and other contributors, http://js.foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <script type="text/html" data-help-name="ot2auth"> <p>aN Opentext Core OAuth2 client which sends an ot2 token in the payload.access_token object as output.</p> <h2 id="inputs">Inputs</h2> <p>Any message to trigger producing an access_token.</p> <h4 id="grant-type">Grant Type</h4> <ul><li><code>Client Credentials</code></li></ul> <ul><li><code>- Set by msg.ot2authRequest -</code></li></ul> <p><strong>input:</strong> </p> <p><code>client_credentials</code></p> <pre><code> msg.ot2authRequest = { "access_token_url": "https://otdsauth.ot2.opentext.com/oauth2/token", "credentials": { "client_id": "clientid", "client_secret": "clientsecret", } }; return msg; </code></pre> <h2 id="outputs">Outputs</h2> <ol> <li>Standard output</li> </ol> <p><code>msg.payload object</code></p> <pre><code> { "_msgid": "781bff99.670d", "topic": "opentext", "payload": { "access_token": "d9e551a7-e165-4186-bf4c-3ff16135d55b", "token_type": "bearer", "refresh_token": "567d3f0b-af7e-421e-a0d9-fae99e010173", "expires_in": 43199, "statuCode": "200" } } } } </code></pre><ol> <li>Standard output error</li> </ol> <p><code>msg.payload object</code></p> <pre><code> { _msgid: '9f97a5b8.ff13f8', topic: 'opentext', payload: { statusCode: 400, statusMessage: 'Bad Request', body: { message: 'Invalid grant: user credentials are invalid', error: { statusCode: 400, status: 400, code: 400, message: 'Invalid grant: user credentials are invalid', name: 'invalid_grant' } } } } </code></pre><h2 id="generic-error">Generic error</h2> <p>Err object describing the cause of a failed operation.</p> <p><code>msg.err object</code> </p> <pre><code> { _msgid: 'd45ffa20.0f28e8', topic: 'opentext', payload: 1552255377233, err: { code: 'ECONNRESET', path: null, host: 'localhost', port: '8000' } } </code></pre><h2 id="details">Details</h2> <p>This node is intended to be used for communicating with Opentext Core protected APIs. Once you configured it, for each incoming message the node will emit a message containing the msg.payload value which can be passed to other nodes sending messages to an OAuth protected API.</p> <h2 id="references">References</h2> <p><a href="https://tools.ietf.org/html/rfc6749">The OAuth 2.0 Authorization Framework</a> - The OAuth 2.0 authorization framework enables a third-party application to obtain limited access to an HTTP service, either on behalf of a resource owner by orchestrating an approval interaction between the resource owner and the HTTP service, or by allowing the third-party application to obtain access on its own behalf. This specification replaces and obsoletes the OAuth 1.0 protocol described in RFC 5849.</p> </script>