The shape of the flow
Choosing a strategy
Every session is created against an authentication strategy — a template that defines which fields the target system needs (username/password, bearer token, custom headers, TOTP, and so on). The strategy determines what the hosted form renders, so you don’t have to build or maintain a credential UI per integration. Strategy ids are provisioned by Rubie for your account. You’ll typically hold one per system you integrate with.Creating a session
name is optional and is only a label for the vaulted credential in the Rubie
dashboard. Something that identifies the end user or their account is a good
choice — it’s what your team will see when debugging a run.
return_url is optional. Its exact origin — scheme, host, and port — must be
allowlisted for your account by Rubie. Paths and query strings can vary beneath
that origin. For example, allowlisting https://app.example.com permits both
https://app.example.com/settings and
https://app.example.com/onboarding?step=connect, but not an http:// URL, a
subdomain, or another port.
Sessions expire after 7 days by default. hosted_url is populated only while
status is pending; once a session is completed or expired it returns
null, so the link cannot be reused.
Presenting the form
Openhosted_url in a new tab or an iframe. Either works — pick based on how
much you want the flow to feel embedded.
If users should choose from several Blueprints inside your product, use the
Embedded Credential Capture widget
instead. It provides a Blueprint picker, an origin-bound iframe, browser
lifecycle events, and the selected Blueprint key on completion.
The user may not finish in one sitting, and some strategies redirect out to the
target system’s own login. Neither breaks anything: the session stays pending
until it’s either submitted or expires, so you can re-open the same hosted_url
as long as it’s still valid.
Returning to your app
After the user submits successfully, Rubie redirects them to yourreturn_url
with the session id appended:
session_id from the redirect and confirm the session through your backend
with the authenticated API:
status is completed, credential_id is populated. Store it against the
user in your own database — Rubie does not own the mapping between your users
and their credentials. That id is stable for the life of the credential.
If the returned status is still non-terminal, poll every 2 seconds until it
settles. This can happen as Rubie adds verification between form submission and
completion. In the normal user-present flow, polling starts only after the
redirect and lasts seconds — clients should not poll continuously for the
session’s full seven-day lifetime.
If you omit return_url, the hosted page shows a success message and tells the
user they can close the tab. In that fallback flow, start polling when you open
hosted_url and stop when the user closes the flow, the session reaches a
terminal state, or your own short timeout expires. The session can still be
checked later on an explicit user action.
Today,
completed means the credentials were collected and vaulted — not that
they were tested. Validity is checked on the first Blueprint run, so a typo’d
password surfaces as a failed run rather than a failed connection. In-session
verification is planned and will arrive as an extra non-terminal status, not
as a change to the meaning of completed.Reconnecting and revoking
Credentials go stale: users rotate passwords, revoke tokens, or churn. Two things to build for. Reconnect. There’s no “update credential” step in this flow. To replace a stale credential, create a new session, and swap the stored id once it completes. Revoke. When a user disconnects, delete the credential:Idempotency
BothPOST /credential-sessions and DELETE /credentials/{id} accept an
Idempotency-Key. Key it on the user or connection rather than the attempt, so a
double-submitted “Connect” button replays the original session instead of
creating a second one. See Idempotency.
Next
- Embedded Credential Capture — add a Blueprint picker and credential flow to your product
- Triggering Blueprint runs — put the credential to work
- Auth strategies — the field model behind the hosted form
- Identifiers — what
sess_,strat_, andcred_ids mean