# OFAuth integration
This application uses OFAuth V3.
Documentation: https://docs.ofauth.com/v3
## Current task
Connect a Sandbox account and display its profile.
## Configuration
- Environment: Sandbox
- Client ID variable: OFAUTH_CLIENT_ID
- Client secret variable: OFAUTH_CLIENT_SECRET
- Sandbox authorization variable: OFAUTH_AUTHORIZATION_ID
- Linked account variable: OFAUTH_LINKED_ACCOUNT_ID
- Requested scopes: profile:read
- Webhook secret variable: OFAUTH_WEBHOOK_SECRET
## Application paths
- Authorization start: replace with our backend route
- OAuth callback: replace with our callback handler
- Token storage: replace with our encrypted storage module
- Linked-account records: replace with our account repository
- Webhook receiver: replace with our receiver route
- Integration checks: replace with our test command
## Integration rules
- Keep secrets, PKCE verifiers, and tokens on the backend.
- Associate authorizations and linked accounts with the user and environment.
- Let your auth framework or application own ordinary token persistence and refresh. Supply its access token or getter to the SDK.
- Verify the original webhook body before using event data.
- Save events and check for duplicates before updating customer records.
- Follow recovery.action. If a write has no clear result, check whether it completed before repeating it.
- Use the official V3 SDK for our language.