SeleID

Reference

Errors and security notes

Overview · React Native and Expo · Android · iOS · Register an app · API reference · Errors and security · Changelog

Coming soon @seletech/seleid-client is not on npm yet. These pages describe version 0.1.0 so you can plan an integration. See the roadmap.

Errors

Every failure is a SeleIdError. Branch on error.kind only. Useful fields: kind, code (SeleID error code), status, requestId, retryAfter (seconds), correlationId. Messages never contain tokens or personal data. isSeleIdError(value) narrows an unknown value.

kindMeaningWhat your app does
timeoutHard timeout hitUnknown outcome. Keep tokens. Retry later; sensitive actions stay blocked
networkNo connection or no fetchSame as timeout
unavailable5xx, temporarily_unavailable, context_timeout, token storage unreadableSame as timeout
unauthenticatedNo session, malformed or expired token, rejected codeSign in again (a refresh is tried automatically for an expired token)
revokedsession_revoked, invalid_grant, generation mismatchSession is over: tokens cleared, go to sign-in
disabledaccount_disabled, account_suspended, account_banned, unknown statusSession is over: tokens cleared
deletedaccount_deletedSession is over: tokens cleared
recoveringaccount_recoveringSend the person to account recovery
forbiddenforbidden, invalid_client, HTTP 403Check client id and registration; do not retry
rate_limitedrate_limited, HTTP 429Wait retryAfter seconds
conflictconflict (for example a preferences version clash)Reload and retry the change
invalid_requestinvalid_request, unsupported_grant_type, not_found, method_not_allowed, payload_too_largeFix the call; do not retry
schema_mismatchResponse did not match the contractReport a bug; treat as unknown
crypto_unavailableNo crypto.subtlePass a CryptoPort to createVerifier

Helpers: error.isUnknown is true for timeout, network and unavailable (fail closed on sensitive actions, keep the screen usable). error.endsSession is true for revoked, disabled and deleted. A 5xx is always unavailable, whatever the body says.

Security notes

  • Public clients only. Mobile and browser apps use PKCE S256 and have no client secret. Never ship a secret in an app.
  • Store tokens in secure storage. Keystore or Keychain-backed storage (expo-secure-store on Expo). Never AsyncStorage, localStorage, logs or crash reports. The stored blob holds the refresh token.
  • Use the system browser for sign-in (Custom Tabs, ASWebAuthenticationSession, expo-web-browser), never an embedded WebView.
  • Check state on return and send a fresh random nonce and PKCE verifier for every attempt.
  • Exact redirect URIs. https, loopback http, or a reverse-DNS custom scheme.
  • Refresh tokens rotate. The SDK never retries a refresh and persists the new token before use. Do not run your own parallel refresh.
  • Fail closed. A timeout never signs the person out, and never counts as success for a sensitive action.
  • Pass the SDK a fetch you trust. Endpoints from discovery are rejected if they are not on the configured SeleID origin.
  • Telemetry is safe by construction but still send it only to your own logger.
  • Report vulnerabilities through the security page.

Last updated 2026-11-12Suggest an editReport a problem with this page