Create OAuth App - The Safe Haven Way
Secure authentication requires a public key. Safe Haven provides terminal commands to generate this using OpenSSL (ensure you have it installed)
A Step-by-Step Guide
Welcome to this comprehensive guide on setting up your own OAuth application within the Safe Haven ecosystem. OAuth, or Open Authorization, is the industry-standard protocol for authorization that allows applications to gain limited access to a user's account on an HTTP service without sharing their password. Whether you're a developer integrating APIs for fintech solutions or just testing the waters, creating an app on the Safe Haven dashboard is straightforward. This tutorial is based on the developer center process and focuses on private apps for API access, including key generation for secure authentication. Follow these steps to get started. If you don't have an account, you can setup one at Safe Haven.
Step 1: Navigate to the Developer Center
- Log in to your Safe Haven account Link.
- Head to the Developer Center section.
- Click on OAuth Apps to view your existing apps (if any).
- Select Add OAuth App to begin the creation process.

Step 2: Enter Your App Name
- Provide a unique and descriptive name for your app.
- Example: "Safe Haven Test App".
This name helps identify your app in the dashboard and during integrations.
Step 3: Select the App Type
Safe Haven offers two app types:
- Public: Ideal for users implementing checkouts via SDK. This requires additional fields like Redirect URL, Website URL, and Icon URL. Use this if your app focuses on public-facing payment gateways.
- Private: Perfect for direct API access, such as custom integrations for transfers or data management. No extra URLs needed here, this is recommended for backend API usage.
For API-driven apps, choose Private.
Step 4: Choose the App Scope
The scope determines your app's permissions:
For most practical uses involving transactions, select Read, Write, and Pay.
Step 5: Add an App Description
- Write a brief description of your app's purpose.
- Example: "This app is for testing Safe Haven API integrations."
This helps with internal tracking and compliance.
Step 6: Generate and Add Your Public Key
Secure authentication requires a public key. Safe Haven provides terminal commands to generate this using OpenSSL (ensure you have it installed).
- Generate the Private Key:
- Copy the provided private key generation command from the dashboard prompt.
- Paste it into your terminal and run it (e.g., openssl genrsa -out private_key.pem 2048).
- This creates a private_key.pem file.
- Generate the Public Key (from the Private Key):
- Copy the public key generation command from the dashboard.
- Paste and run it in the terminal (e.g., openssl rsa -in private_key.pem -out public_key.crt -outform PEM -pubout).
- You'll be prompted for details:
- Country Name (e.g., "NG" for Nigeria)
- State/Province Name (e.g., "Lagos")
- Locality Name (e.g., "City")
- Organization Name (e.g., "Safe Haven")
- Organizational Unit Name (e.g., "Technical")
- Common Name (e.g., "safehaven.com")
- Email Address (e.g., "[email protected]")
- View and Copy the Public Key:
- Use a command like nano public_key.crt (or cat public_key.crt) to display the key.
- Copy the entire contents (including -----BEGIN PUBLIC KEY----- and -----END PUBLIC KEY-----).
- Paste into the Dashboard:
- Return to the app creation form and input the public key in the designated field.
- Submit the form to complete app creation.
Your app is now live! You'll receive API keys and credentials for integration.
Key Tips for Success
- Security First: Keep your private key secure—never share it. The public key is safe to upload.
- Testing: Use the sandbox environment (as mentioned in related guides) to test your app without real transactions.
- Troubleshooting: If prompts during key generation confuse you, refer to OpenSSL documentation or Safe Haven's support.
- Next Steps: Once created, explore API endpoints for transfers, user management, and more.