ReachFive Developer Documentation
website·Indexed 33 days ago
https://developer.reachfive.com/docs/Developer guides and API references for ReachFive and Purse Identity, including SDKs for Android, iOS, Core, and UI. Documentation covers social login integration with Amazon, identity API specifications, and implementation details for WebAuthn and account recovery.
What's inside ReachFive
- Purse Identity allows users to log in using various social providers. The general process for integrating a social provider involves two main steps: creating the Social Application within the provider's own platform and then configuring that application in the Purse Identity Console. If a required provider is not natively supported, a custom identity provider can be configured in the Purse Identity Console.
Overview of Identity Fraud Protection (IFP)
The Identity Fraud Protection (IFP) module analyzes login and signup attempts to detect suspicious IP behavior. When a suspicious IP is identified, it is flagged and blocked immediately.
Key capabilities include:
- Reducing the impact of credential stuffing attacks.
- Preventing bots from performing bulk signup requests.
- Blocking suspicious IPs immediately.
- Whitelisting trusted IPs to bypass protection policies.
- Automatic temporary suspension of accounts if a malicious IP successfully accesses an account (blocks password, OTP, Passkey, and SSO; social login remains usable).
Understand OAuth 2.0 Scopes in Purse Identity
Scopes are used to limit an application's access to a user's account. An application requests one or more scopes, which are presented to the user on a consent screen. The resulting access token is limited to the scopes granted by the user, ensuring that the application only accesses authorized data as per RFC 6749.Enable Data Breach Detection
Data Breach Detection identifies leaked passwords by scanning known credential leaks and cross-referencing them with login, signup, or password update attempts. When a leak is detected, users can be temporarily suspended (if configured) and notified via email or SMS templates. This feature is enabled directly within the Purse Identity Console.Interpret ReachFiveError responses
The
ReachFiveErrorobject provides detailed information about failed requests. Key properties include:message: General error message.code: The HTTP status code or SDK error code.getErrorCode(): Returns theErrorCodeenumeration value.data: AReachFiveApiErrorobject containing:errorUserMsg: A translated, user-friendly error message.errorMessageKey: The technical error code.errorDescription: The technical error message.errorDetails: A list ofReachFiveApiErrorDetailsmapping specific fields to error messages.
Reference ID token payload claims
The
idTokenPayloadwithin theAuthResultobject contains claims about the authenticated user. Key claims include:sub: Unique subject identifier.email/emailVerified: User's email and its verification status.givenName/familyName/name: User's first, last, and full name.gender: Allowed values arefemale,male, andother.auth_time: Time of authentication.newUser: Boolean indicating if the user is new.picture/profile: URLs to the user's image and profile.
ID Token Payload Claims Reference
The
idTokenPayloadwithin theAuthResultcontains claims about the authenticated user, including:- sub: Subject identifier
- name: Full name
- givenName: First name
- familyName: Last name/surname
- email: User email
- emailVerified: Boolean indicating if email is verified
- gender:
female,male, orother - birthdate: User birthdate
- locale: User locale
- picture: User profile picture URL
- newUser: Boolean indicating if the user is new
- auth_time: Time of authentication
- exp: Expiration time
- iat: Issued at time
- iss: Issuer
Implement user-event webhooks
User-event webhooks allow you to trigger external URLs when specific user actions occur (e.g., sign-up or account deletion). Purse Identity supports two types of webhooks:
- Post-event webhooks: Triggered asynchronously after the event is processed. The API returns a response immediately, and the user is not blocked. This is the recommended type.
- Pre-event webhooks: Triggered before the event is processed. These are synchronous and can be used to send additional data or prevent the event from proceeding. They suspend the API response, so a timeout (default 10 seconds) is critical to prevent user blockage.
Pre-event Webhook Behavior on Failure:
- Continue processing: The event proceeds as if no webhook existed (may lead to unsynchronized data).
- Prevent processing: The event is blocked and an error is returned (ensures data consistency).
Understand the ApiError structure
The
ApiErrorobject provides detailed information about a failed request, including:error: The main error message.errorId: Unique identifier for the error.errorUserMsg: A localized, user-friendly message (supports multiple languages including English, Spanish, French, German, Chinese, etc.).errorMessageKey: The key used for the error message.errorDescription: Technical details of the error.errorDetails: An array ofFieldErrorobjects containing the specificfield,message, andcodefor validation errors.
Reference ID Token payload claims
The
idTokenPayloadwithin theAuthResultcontains claims about the authenticated user. Common claims include:- sub (string): Subject identifier.
- name (string): Full name of the user.
- givenName (string): First name.
- familyName (string): Last name/surname.
- email (string): User email address.
- emailVerified (boolean): Whether the email is verified.
- gender (string): Allowed values:
female,male,other. - birthdate (string): User's birthdate.
- locale (string): User's locale.
- picture (string): URL to the user's profile picture.
- newUser (boolean): Indicates if the user is new.
- iss (string): Issuer of the token.
- aud (string): Audience of the token.
- exp (number): Expiration timestamp.
- iat (number): Issued-at timestamp.
Handle ReachFiveError in iOS SDK
The
ReachFiveErrorenum provides detailed information about failures during authentication and MFA processes.AuthCanceled: The user canceled the request, no passkey was found, or a concurrent web login interrupted the process.RequestError(apiError: ApiError): Occurs for Bad Request (HTTP 400) errors.AuthFailure(reason: String, apiError: ApiError?): Occurs primarily for Unauthorized (HTTP 401) errors.TechnicalError(reason: String, apiError: ApiError?): Occurs for Internal Server Errors (HTTP 500) or other internal failures.
The nested
ApiErrorobject containserrorUserMsg(a localized, user-friendly message),errorId,errorMessageKey, anderrorDescription.Retrieve authorized user information
To get information about an authorized user, use the/identity/v1/userinfoendpoint. Alternatively, you can decode theid_tokenobtained after a successful login to retrieve the authorized attributes contained within the token.