Basic login methods
Email login
Email authentication provides a passwordless login experience using one-time passwords (OTPs) sent directly to users’ email addresses. How it works:- User enters their email address
- MoonKey sends a 6-digit OTP to their email
- User enters the OTP to complete authentication
- OTP expires after 10 minutes
- Navigate to SDK Settings in your dashboard
- Enable the Email authentication option
- Optionally customize the email template in Email Templates
Email addresses are automatically verified through the OTP process. Users who authenticate via email will have their email marked as verified in their account.
Wallet login
Wallet-based authentication allows users to sign in using their existing Web3 wallets through cryptographic signature verification. Supported wallet authentication:- Sign In With Ethereum (SIWE) — Authenticate users with any Ethereum or EVM-compatible wallet
- Sign In With Solana (SIWS) — Authenticate users with Solana wallets
- User connects their Web3 wallet (MetaMask, Phantom, etc.)
- MoonKey generates a signature request
- User signs the message in their wallet
- MoonKey verifies the signature and authenticates the user
- Navigate to SDK Settings in your dashboard
- Enable Wallet authentication
- Select which blockchain networks to support (Ethereum, Solana, or both)
Social providers (OAuth)
MoonKey supports OAuth-based authentication through popular social providers, allowing users to sign in with their existing social accounts.Supported OAuth providers
- Google — Let users sign in with their Google account
- Apple — Let users sign in with their Apple ID
Additional OAuth providers (Microsoft, Discord, GitHub, and more) are coming soon. Contact us if you need support for a specific provider.
Configuring your OAuth credentials
To use OAuth authentication, you must configure your own OAuth credentials for each provider. MoonKey does not provide default credentials. Benefits of using OAuth:- Your branding appears on the authentication screen
- Users can leverage existing accounts they trust
- Streamlined onboarding without password creation
- Automatic email verification through the provider
Configuring custom OAuth credentials
1
Create OAuth apps with each provider
For each social provider you want to support, create an OAuth application through their developer portal:
- Google: Google Cloud Console
- Apple: Apple Developer Portal
2
Enter credentials in MoonKey Dashboard
After creating your OAuth apps, navigate to the OAuth section in your MoonKey Dashboard:
- Select the provider you want to configure
- Enter your OAuth credentials (Client ID and Client Secret)
- Save the configuration
3
Enable the provider
Once your credentials are configured:
- Navigate to SDK Settings
- Enable the OAuth providers you want users to access
- The authentication options will appear in your application’s login flow
Provider-specific setup guides
Google OAuth
Google OAuth
Creating a Google OAuth application:
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google+ API
- Navigate to Credentials and create OAuth 2.0 credentials
- Add
https://auth.moonkey.fun/api/v1/oauth/callbackas an authorized redirect URI - Copy your Client ID and Client Secret
openidemailprofile
Google OAuth may not work in in-app browsers (like those embedded in social media apps) due to Google’s security restrictions. Consider enabling additional login methods for broad compatibility.
Apple OAuth
Apple OAuth
Creating an Apple OAuth application:
- Visit Apple Developer Portal
- Create a new Services ID under Certificates, Identifiers & Profiles
- Enable Sign in with Apple capability
- Configure the redirect URL:
https://auth.moonkey.fun/api/v1/oauth/callback - Create a private key for your Services ID
- Note your Team ID, Services ID, and Key ID
- Team ID: Your Apple Developer team identifier
- Services ID: Your application’s services identifier
- Key ID: The identifier for your Sign in with Apple key
- Private Key: The .p8 private key file
Testing your configuration
After enabling login methods, test each one in your development environment:- Initialize the MoonKey SDK with your development App ID
- Attempt to authenticate using each enabled method
- Verify users can successfully log in and their data appears in the dashboard
- Test the user experience across different browsers and devices
Best practices
Security:- Store OAuth credentials securely and never commit them to version control
- Use separate apps and credentials for development, staging, and production
- Regularly rotate OAuth secrets according to your security policies
- Enable multiple authentication methods to accommodate different user preferences
- Provide clear messaging about which login methods are available
- Consider regional availability when choosing authentication options
- Review each OAuth provider’s terms of service and usage requirements
- Ensure your privacy policy covers data collected through social logins
- Maintain compliance with data protection regulations (GDPR, CCPA, etc.)