Skip to content

MojoAuth/ios-native-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MojoAuth Flutter iOS SDK

MojoAuth's Flutter SDK workspace for native iOS social authentication.

Current native provider support:

  • Google Sign-In
  • Facebook Login
  • Sign in with Apple

Current gap:

  • OIDC / AppAuth flow is scaffolded but not implemented yet

Workspace Layout

  • packages/mojoauth_platform_interface Shared models, errors, and platform contracts
  • packages/mojoauth_flutter Flutter-facing SDK API
  • packages/mojoauth_ios Native iOS implementation
  • apps/mojoauth_demo Demo app for QA, customer onboarding, and local validation

Quick Start

Install dependencies and run the demo:

cd apps/mojoauth_demo
flutter pub get
flutter run

Demo Configuration

The demo app reads configuration from --dart-define values so real credentials do not need to live in source control.

Example:

flutter run \
  --dart-define=MOJOAUTH_API_BASE_URL=https://api.mojoauth.com \
  --dart-define=MOJOAUTH_API_KEY=replace-with-mojoauth-api-key \
  --dart-define=MOJOAUTH_IOS_BUNDLE_ID=com.mojoauth.demo \
  --dart-define=MOJOAUTH_GOOGLE_CLIENT_ID=replace-with-google-ios-client-id \
  --dart-define=MOJOAUTH_FACEBOOK_APP_ID=replace-with-facebook-app-id \
  --dart-define=MOJOAUTH_FACEBOOK_CLIENT_TOKEN=replace-with-facebook-client-token \
  --dart-define=MOJOAUTH_FACEBOOK_DISPLAY_NAME="MojoAuth Demo"

Optional OIDC values:

--dart-define=MOJOAUTH_CLIENT_ID=replace-with-client-id
--dart-define=MOJOAUTH_REDIRECT_URI=com.mojoauth.demo:/callback
--dart-define=MOJOAUTH_ISSUER=https://api.mojoauth.com/.well-known/openid-configuration
--dart-define=MOJOAUTH_GOOGLE_SERVER_CLIENT_ID=replace-with-google-web-client-id
--dart-define=MOJOAUTH_GOOGLE_HOSTED_DOMAIN=example.com

iOS Native Setup

Update apps/mojoauth_demo/ios/Runner/Info.plist before testing native providers:

  • Google: add the reversed Google iOS client ID under CFBundleURLSchemes
  • Facebook: replace replace-with-facebook-app-id and replace-with-facebook-client-token
  • Apple: enable the Sign in with Apple capability for the app target

MojoAuth Backend Expectations

Google native login:

  • MojoAuth route: GET /users/social/google
  • request value: google_access_token=<google_id_token>
  • the Google JWT aud must match one of the configured Google client IDs for the project

Facebook native login:

  • MojoAuth route: GET /users/social/facebook
  • request value: fb_access_token=<facebook_access_token>

Apple native login:

  • MojoAuth route: POST /users/social/apple
  • request body: Apple authorization code plus native identity token

Security Notes

  • Do not commit real API keys, provider client tokens, or test customer credentials
  • Do not log raw Apple authorization codes or identity tokens in production builds
  • Keep provider secrets in MojoAuth backend configuration, not in the Flutter app

Validation

Recommended checks before a release:

cd packages/mojoauth_platform_interface && flutter analyze && flutter test
cd ../mojoauth_flutter && flutter analyze && flutter test
cd ../mojoauth_ios && flutter analyze && flutter test
cd ../../apps/mojoauth_demo && flutter analyze && flutter test

Release Readiness

Before publishing this repository publicly:

  • replace all placeholder native app values in the demo when doing manual testing
  • keep placeholder values in committed source
  • remove local build output and .dart_tool directories
  • confirm Apple, Google, and Facebook setup steps in the customer documentation

About

MojoAuth iOS Native SDK is a lightweight library that helps developers add passwordless authentication—like OTP and email magic links—to iOS apps quickly and securely, with minimal setup.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors