Creating Custom OAuth Button
Note: The following steps are for apps built on code-based platforms. If you are using no-code platform like Bubble, visit the documentation here instead.
Design your own HTML snippet
Steps breakdown
- Include the helper tag by injecting the script element
- Add the html connect block with necessary attributes
- Show state of html block as connected or not
- Show disconnect button
The Script tag is the primary include that loads all the libraries based on what is needed. In this case you only need it to load the pinc.oauth.min library
Replacements
Replacement | Description |
---|---|
PATHFIX PUBLIC KEY | The Public key for your Pathfix Application. See Pathfix keys to learn more |
END USER ID | The Identifier used by your app to identify the logged in user (a unique ID you associate your user with) |
| |
Add the following HTML block to your page. You can customize the html in any manner you want. Just ensure that the attributes are included as specified.
Replacements
Replacement | Description |
---|---|
PATHFIX PUBLIC KEY | The Public key for you Pathfix Application. See Pathfix keys to learn more |
END USER ID | The Identifier used by your app to identify the logged in user. (a unique ID you associate your user with) |
PROVIDER NAME | The internal provider reference for your added integration. See Provider reference to learn more |
There are two ways to do this.
- (Recommended) Make an API Call (Proxied by your server) to the provider and check the response for errors
- Make a call to the User Connection API(Proxied by your server) to check whether the User is Authorized.
Offer your users the ability to disconnect or revoke their authorization. Call the Revoke Connection API (Proxied by your server) available on the User Connection page under the Revoke User Connection section.
Proxy API's through your Server
All API calls either to the Provider or Pathfix API should be proxied by your server as they will include the Private Key.