How do I start user authentication?
There are two ways to authenticate users
There are two ways to authenticate users:
Generate a widget session via generateWidgetSession and redirect the user to the returned URL, where they pick a provider and are returned with user_id and reference_id.
Call authenticateUser with resource set to the provider (for example GARMIN, WITHINGS) and redirect to the returned auth_url. See custom UI implementation.
Configure your API key, dev-id, data destination and data sources in the dashboard first.
Auth tokens from /auth/generateAuthToken are mapped to your dev-id, are single-use, and expire after 300 seconds. They are not bound to a reference_id, so bind the connection by supplying reference_id at connection-init time, and keep tokens server-side.
If authenticateUser returns { message: null }, your headers are likely swapped: dev-id must carry the human-readable developer ID and x-api-key the long API key. Correct headers return an auth_url field. See the authentication flow.
Last updated
Was this helpful?