OAuth

Ruby Native handles the complete client-side OAuth flow for Sign in with Google, GitHub, and other providers. Users sign in through a secure system browser, and the app captures the session automatically. No extra code needed beyond configuration.

Ruby Native hooks into your existing OAuth implementation. You still set up the provider credentials, OmniAuth strategy, and callback handling in your Rails app as usual. Ruby Native only handles the native side: opening the browser sheet, capturing the session, and returning the user to the app.

#Configuration

Add an auth section to config/ruby_native.yml listing every path that starts an OAuth flow:

auth:
  oauth_paths:
    - /auth/google_oauth2
    - /auth/github
    - /auth/apple

These should match the paths your OAuth library uses. For OmniAuth, it's typically /auth/{provider}. Each provider uses the same flow.

That's it. The gem and the native app handle everything else.

#What the user sees

  1. The user taps "Sign in with Google" (or another provider) in your app.
  2. A system browser sheet slides up with the provider's sign-in page.
  3. The user picks an account or enters their credentials.
  4. The browser sheet closes and they land on the logged-in page inside the app.

Your existing sign-in buttons, links, and views all work as-is. The native app detects the OAuth flow and handles the browser sheet automatically.

#Auth failures

If the user cancels or the provider returns an error, the browser sheet closes and the app stays on the sign-in page. No crash, no broken state.

#Sign in with Apple

App Review guideline 4.8 kicks in the moment your app offers a third-party or social login like Google or GitHub: you must also offer a privacy-focused option. Sign in with Apple is the obvious way to satisfy it, since it limits data to name and email, lets users hide their address, and collects nothing for ads.

You're exempt if any of these apply:

  • Your app exclusively uses your own account system (e.g. email and password)
  • Your app is for education or enterprise and requires an existing work or school account
  • Your app is a client for a specific third-party service where users sign in to that account directly to access their content (e.g. a Gmail client signing in with Google)

Most Rails apps with their own authentication are exempt under the first bullet. If Google or GitHub OAuth is your primary sign-in for individual consumers, plan for Sign in with Apple or a claim on one of the exemptions. Google Play has no equivalent requirement.