# google/googlesignin-ios architecture

> Architecture diagram of the GitHub repository google/googlesignin-ios, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/google/googlesignin-ios
- Repository: https://github.com/google/googlesignin-ios

## Overview

Google Sign-In is an iOS/macOS SDK that lets an app initiate Google account authentication and receive a sign-in result and user credentials. The principal documented workflow starts at an app-provided button or direct API call, invokes the core sign-in API, and returns a result to the app; on macOS the SDK uses the default browser. The tree and README establish additional capabilities, but most core implementations are unsampled, so those links are shown as unverified rather than asserted calls.

Main entry points: [`GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h`](https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h) (Sign-in API), [`GoogleSignInSwift/Sources/GoogleSignInButton.swift`](https://github.com/google/googlesignin-ios/blob/main/GoogleSignInSwift/Sources/GoogleSignInButton.swift) (SwiftUI button), [`GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignInResult.h`](https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignInResult.h) (Sign-in result), [`GoogleSignIn/Sources/Public/GoogleSignIn/GIDGoogleUser.h`](https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/Public/GoogleSignIn/GIDGoogleUser.h) (Google user)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Sign-in SDK"]
  node_signin["Sign-in API<br/>[GIDSignIn.h]"]
end

subgraph group_identity["Identity and credentials"]
  node_result["Sign-in result<br/>[GIDSignInResult.h]"]
  node_user["Google user<br/>[GIDGoogleUser.h]"]
  node_tokens["Auth tokens<br/>[GIDToken.h]"]
  node_scopes["Scope handling<br/>[GIDScopes.h]"]
  node_migration["Auth migration"]
end

subgraph group_security["Security features"]
  node_appcheck["App Check<br/>[GIDAppCheck.h]"]
  node_emm["Enterprise errors"]
  node_emm_presenter["EMM alert UI"]
  node_local_auth["Passcode probe"]
end

subgraph group_ui["Sign-in UI"]
  node_swift_button["SwiftUI button"]
  node_button_model["Button model"]
  node_button_style["Button styling"]
  node_uikit_button["UIKit button<br/>[GIDSignInButton.h]"]
end

node_app(("Integrating app"))
node_google{{"Google account service"}}
node_browser(("Default browser"))

node_app -->|"uses"| node_swift_button
node_app -->|"uses"| node_uikit_button
node_app -->|"invokes"| node_signin
node_swift_button -->|"action invokes"| node_signin
node_signin -.->|"returns"| node_result
node_result -.->|"provides"| node_user
node_user -.->|"contains"| node_tokens
node_signin -.->|"authenticates with"| node_google
node_signin -->|"opens"| node_browser
node_signin -.->|"supports"| node_scopes
node_signin -.->|"migrates legacy state"| node_migration
node_signin -.->|"uses"| node_appcheck
node_signin -.->|"handles errors"| node_emm
node_emm -.->|"presents alerts"| node_emm_presenter
node_signin -.->|"probes passcode"| node_local_auth
node_swift_button -->|"observes"| node_button_model
node_button_model -.->|"derives style"| node_button_style

click node_signin "https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h"
click node_result "https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignInResult.h"
click node_user "https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/Public/GoogleSignIn/GIDGoogleUser.h"
click node_tokens "https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/Public/GoogleSignIn/GIDToken.h"
click node_scopes "https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/GIDScopes.h"
click node_migration "https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/GIDAuthStateMigration/GIDAuthStateMigration.h"
click node_appcheck "https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.h"
click node_emm "https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/GIDEMMErrorHandler.h"
click node_emm_presenter "https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/GIDEMMAlertPresenter/Implementation/GIDEMMAlertWindowPresenter.h"
click node_local_auth "https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/GIDLocalAuthentication/API/GIDLocalAuthenticationContext.h"
click node_swift_button "https://github.com/google/googlesignin-ios/blob/main/GoogleSignInSwift/Sources/GoogleSignInButton.swift"
click node_button_model "https://github.com/google/googlesignin-ios/blob/main/GoogleSignInSwift/Sources/GoogleSignInButtonViewModel.swift"
click node_button_style "https://github.com/google/googlesignin-ios/blob/main/GoogleSignInSwift/Sources/GoogleSignInButtonStyling.swift"
click node_uikit_button "https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignInButton.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_signin,node_browser toneBlue
class node_result,node_user,node_tokens,node_scopes,node_migration toneAmber
class node_appcheck,node_emm,node_emm_presenter,node_local_auth toneMint
class node_swift_button,node_button_model,node_button_style,node_uikit_button toneRose
class node_app,node_google toneIndigo
```

## Components

### Sign-in SDK

- [Sign-in API](https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h): `GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h`

### Identity and credentials

- [Sign-in result](https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignInResult.h): `GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignInResult.h`
- [Google user](https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/Public/GoogleSignIn/GIDGoogleUser.h): `GoogleSignIn/Sources/Public/GoogleSignIn/GIDGoogleUser.h`
- [Auth tokens](https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/Public/GoogleSignIn/GIDToken.h): `GoogleSignIn/Sources/Public/GoogleSignIn/GIDToken.h`
- [Scope handling](https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/GIDScopes.h): `GoogleSignIn/Sources/GIDScopes.h`
- [Auth migration](https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/GIDAuthStateMigration/GIDAuthStateMigration.h): `GoogleSignIn/Sources/GIDAuthStateMigration/GIDAuthStateMigration.h`

### Security features

- [App Check](https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.h): `GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.h`
- [Enterprise errors](https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/GIDEMMErrorHandler.h): `GoogleSignIn/Sources/GIDEMMErrorHandler.h`
- [EMM alert UI](https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/GIDEMMAlertPresenter/Implementation/GIDEMMAlertWindowPresenter.h): `GoogleSignIn/Sources/GIDEMMAlertPresenter/Implementation/GIDEMMAlertWindowPresenter.h`
- [Passcode probe](https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/GIDLocalAuthentication/API/GIDLocalAuthenticationContext.h): `GoogleSignIn/Sources/GIDLocalAuthentication/API/GIDLocalAuthenticationContext.h`

### Sign-in UI

- [SwiftUI button](https://github.com/google/googlesignin-ios/blob/main/GoogleSignInSwift/Sources/GoogleSignInButton.swift): `GoogleSignInSwift/Sources/GoogleSignInButton.swift`
- [Button model](https://github.com/google/googlesignin-ios/blob/main/GoogleSignInSwift/Sources/GoogleSignInButtonViewModel.swift): `GoogleSignInSwift/Sources/GoogleSignInButtonViewModel.swift`
- [Button styling](https://github.com/google/googlesignin-ios/blob/main/GoogleSignInSwift/Sources/GoogleSignInButtonStyling.swift): `GoogleSignInSwift/Sources/GoogleSignInButtonStyling.swift`
- [UIKit button](https://github.com/google/googlesignin-ios/blob/main/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignInButton.h): `GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignInButton.h`

### Other components

- **Integrating app**
- **Google account service**
- **Default browser**

## Connections

- Integrating app → SwiftUI button: uses (evidence: `README.md`)
- Integrating app → UIKit button: uses (evidence: `README.md`)
- Integrating app → Sign-in API: invokes (evidence: `README.md`)
- SwiftUI button → Sign-in API: action invokes (evidence: `README.md`)
- Sign-in API → Sign-in result: returns
- Sign-in result → Google user: provides
- Google user → Auth tokens: contains
- Sign-in API → Google account service: authenticates with
- Sign-in API → Default browser: opens (evidence: `README.md`)
- Sign-in API → Scope handling: supports
- Sign-in API → Auth migration: migrates legacy state
- Sign-in API → App Check: uses
- Sign-in API → Enterprise errors: handles errors
- Enterprise errors → EMM alert UI: presents alerts
- Sign-in API → Passcode probe: probes passcode
- SwiftUI button → Button model: observes (evidence: `GoogleSignInSwift/Sources/GoogleSignInButton.swift`)
- Button model → Button styling: derives style
