Hosted Auth Guide
Hosted auth lets your app sign members in without managing auth provider credentials or building your own member login screen. Your app sends the member to a TheFaithApp-hosted page, receives a one-time code on your callback URL, exchanges that code for a member token, and then uses that token for normal API calls.When To Use It
Use hosted auth for external web or mobile apps that need to read or update church-scoped member data through thev1 API.
The member signs in once. After that, store the returned TheFaithApp member token securely and use it for future API calls.
What You Need
- A client key from
Settings > Developer Access - One or more saved Redirect URLs
- A backend or mobile client that can exchange the returned code for a token
- A place to store the returned member token securely
Supported Sign-In Methods
The hosted sign-in page supports:- Apple
- Email/password sign in
- Email/password account creation with display name
Redirect URLs
Add every callback that can receive auth codes inSettings > Developer Access.
Examples:
redirect_uri you send to the API must exactly match one saved Redirect URL. If you use a mobile app, register the same deep link or app link scheme in your mobile project.
Hosted auth always runs on the TheFaithApp auth host. Church custom domains do not host the auth page.
Full Flow
- Generate a random
statevalue in your app. - Call
POST /v1/auth/startwith yourclient_key,redirect_uri, andstate. - Open the returned
auth_urlin a browser tab, mobile browser, or mobile auth session. - The member signs in or creates an account.
- TheFaithApp redirects to your
redirect_uriwithcodeandstate. - Confirm the returned
statematches the one you generated. - Call
POST /v1/auth/tokenwith the one-timecode. - Store the returned
access_token. - Call protected
v1endpoints with bothX-API-KeyandAuthorization.
1. Start Sign-In
auth_url for the member. Do not iframe the hosted auth page.
2. Receive The Code
After sign-in, TheFaithApp redirects back to your callback:- read
code - read
state - reject the callback if
statedoes not match the value you generated - exchange
codeimmediately
3. Exchange The Code
access_token securely. For mobile apps, use secure device storage such as Keychain or Keystore. For server-rendered web apps, keep the token server-side or in an HTTP-only secure session cookie.
4. Call The API
Every protectedv1 request needs both headers:
Mobile Apps
For mobile apps, use the platform’s browser-based auth session:- iOS:
ASWebAuthenticationSession - Android: Chrome Custom Tabs or the AppAuth browser flow
- React Native or Flutter: use a browser auth/session package that supports callback URLs
Optional PKCE
Public clients can include PKCE values when starting auth:code_verifier during token exchange:
Logout
To invalidate a member token, callPOST /v1/auth/logout with the same API key and bearer token:
Common Errors
| Status | When it happens | How to fix it |
|---|---|---|
403 | The redirect_uri is not saved for this client key. | Add the exact redirect URL in Developer Access. |
404 | The client_key is unknown. | Confirm you copied the client key from the correct church. |
422 | A required request field is missing or invalid. | Check client_key, redirect_uri, code, and PKCE fields. |
400 | The code is invalid, expired, already used, or the redirect URL does not match. | Start a fresh hosted auth flow and exchange the new code quickly. |
401 | A protected API request has a missing or invalid bearer token. | Exchange the hosted auth code and use the returned member token. |