Authentication - Basic Auth
Connection V1 – Field Explanations
Purpose:
A Connection in viaSocket defines how your plugin securely links to an external service, so users can authorize access to their data.
1. Configure Your Fields
What it is:
This is where you define the input fields needed from the user to authenticate. For Basic Auth, these are usually:
Username / API Key – the identifier for the user or app.
Password / Secret Key – the credential paired with the username or key.
Extra Tips:
Mark fields as required if they are mandatory for all requests.
Provide clear labels and hints so users know exactly what to enter.
Avoid field names like “Key” — be specific, e.g., “API Key” or “Account Username.”
2. Configure Test (Me) API
What it is:
A “test” or ME endpoint verifies that the credentials entered actually work.
viaSocket calls this endpoint right after the user saves their credentials.
If the call is successful, the connection is marked as valid.
Extra Tips:
Choose an endpoint that returns basic account info (e.g.,
/me
or/profile
).Keep responses lightweight for faster verification.
Provide meaningful error messages if the test fails.
3. Add Connection Label
What it is:
A dynamic label that helps users identify their saved connection.
Example:
John's Salesforce Account
instead of a generic “Salesforce Connection.”
Extra Tips:
Use placeholders to pull data from the test API response (e.g., user’s name or email).
This helps when a user has multiple accounts with the same service.
4. Add URLs to Whitelist
What it is:
A list of domains or endpoints viaSocket is allowed to call for this connection.
Acts as a security filter to prevent unauthorized calls to unknown URLs.
Extra Tips:
Only include the base URLs your integration needs.
Avoid wildcards (
*
) unless absolutely necessary.Helps prevent misuse if credentials are compromised.
5. Set Request Parameters
What it is:
Default or fixed parameters that should be included in every API request for this connection.
Example: setting a
version=2
parameter for an API that requires it.
Extra Tips:
Use this for static values that don’t change per request.
Avoid putting sensitive credentials here — those should be in “Configure Your Fields.
