Skip to content

45 — OAuth on Android — Annotated References

Every link has a one-line note explaining why you would open it. Ordered by how often you will actually need them.


Read these first

Document Why
RFC 8252 — OAuth 2.0 for Native Apps The one document that governs this chapter: mandates PKCE, mandates an external user agent, and §8.12 is the normative basis for treating a WebView flow as a finding
RFC 7636 — PKCE §4.1 gives the exact code_verifier charset and length; §4.2 gives the S256 construction you will re-implement to test enforcement
RFC 9700 — OAuth 2.0 Security Best Current Practice The consolidated modern guidance; cite this when a developer says "the spec allows it"
OpenID Connect Core 1.0 §3.1.3.7 The normative id_token validation algorithm — quote it verbatim when reporting a missing aud check

Core specifications

RFC / spec One-line summary
RFC 6749 The OAuth 2.0 Authorization Framework — roles, grants, endpoints, error codes
RFC 6750 Bearer token usage: how a token is presented and what the error responses mean
RFC 6819 The original threat model — still the best source on why each control exists
RFC 7519 JSON Web Token, the container format of every id_token
RFC 7515 JSON Web Signature — the alg header field and why trusting it is circular
RFC 7517 JSON Web Key — the JWKS document you fetch to verify a signature
RFC 7009 Token revocation — the endpoint a correct logout must call
RFC 7662 Token introspection — how a resource server asks the AS what a token means
RFC 7591 Dynamic client registration — relevant when an app registers itself at runtime
RFC 8414 Authorization server metadata — the sibling of OIDC Discovery
RFC 8628 Device Authorization Grant — the TV/console flow with user_code and polling
RFC 8705 mTLS client authentication and certificate-bound tokens
RFC 9126 Pushed Authorization Requests — removes the front channel as a tampering surface
RFC 9207 Issuer identification — the mitigation for mix-up attacks across multiple IdPs
RFC 9449 DPoP — application-layer sender-constrained tokens; pairs with the Android Keystore
OAuth 2.1 draft The consolidation that makes PKCE mandatory and deletes implicit and ROPC
OIDC Discovery 1.0 Defines .well-known/openid-configuration — the cheapest evidence you will collect
OIDC RP-Initiated Logout What a correct logout looks like at the protocol level
FAPI 2.0 Security Profile Financial-grade profile; use as a conformance checklist for a hardened deployment

Android platform

Link Why
Verify Android App Links The verification process behind pm get-app-links, including every way it silently fails
Digital Asset Links The assetlinks.json format and how the fingerprint is computed
Chrome Custom Tabs What a Custom Tab is and what customisation is actually available — useful when arguing against a WebView
CustomTabsIntent The API surface a correct app uses
Intents and intent filters Intent resolution — the mechanism scheme hijacking abuses
Network security configuration Required reading before you can intercept the token exchange
Android Keystore Where a DPoP or attestation key must live
AccountManager Android's account framework; some apps store OAuth tokens here rather than in preferences
Package visibility on Android 11+ Changes what a malicious app can see about your redirect handlers

AOSP source

Path Why it matters
frameworks/base/core/java/android/content/IntentFilter.java matchData — the method that decides whether an app's filter matches a redirect URI. It has no concept of scheme ownership, which is the whole basis of scheme hijacking
frameworks/base/services/core/java/com/android/server/pm/ Package manager intent resolution and App Link verification state
frameworks/base/core/java/android/content/pm/verify/domain/ The domain verification APIs behind pm get-app-links
frameworks/base/core/java/android/webkit/WebView.java The API surface that makes an embedded flow dangerous
Android Code Search Search all of the above without cloning AOSP

Libraries and reference implementations

Link Why
AppAuth-Android The OpenID Foundation's certified client library — the reference implementation of RFC 8252. Refuses to run the flow in a WebView
AppAuth-Android sample app A known-correct flow to diff a target's behaviour against
AppAuth TokenRequest Read this to know exactly what getRequestParameters() returns — the highest-value Frida hook in the chapter
Google Identity Services for Android What "Sign in with Google" actually does on Android today
Nimbus JOSE + JWT A correct JWT validator — use it to demonstrate what a backend should have done
jwt.io Quick decoding during testing. Never paste a real production token into a third-party site

OWASP

Link Why
MASVS MASVS-AUTH, MASVS-NETWORK, MASVS-STORAGE and MASVS-PLATFORM are the controls this chapter maps to
MASTG The Android authentication, deep-link and interception test cases, with concrete procedures
Mobile Top 10 M3 Insecure Authentication/Authorization is where these findings land in an executive summary
OWASP Cheat Sheet Series The OAuth 2.0 and JWT cheat sheets, useful as a remediation appendix

Testing tools

Tool Use
Burp Suite Intercepting both legs of the flow; Repeater is where the PKCE enforcement variants are run
mitmproxy Scriptable alternative, better for automating the enforcement probe
Frida Extracting the code_verifier and detecting WebView flows — see 53-Frida
Objection Fast class search and method watching without writing a script
jadx Decompilation; anchor searches on protocol parameter names, which survive obfuscation
apktool Manifest and resource extraction — the redirect scheme is visible before any decompilation
jq Reading discovery documents and token responses

Further reading

Link Why
oauth.net Aaron Parecki's reference site — the fastest correct answer to "which RFC covers X"
OAuth 2.0 Simplified A readable walkthrough of the whole framework when the RFCs are too dense
Android Security Bulletins Platform-level intent and domain-verification fixes that change what the attacks above can do
Google Project Zero Deep mobile IPC and deep-link research
PortSwigger Web Security Academy — OAuth Free hands-on labs; the web-side attacks translate directly to the mobile front channel

Chapter Relationship
26-Intent Intent resolution — the mechanism that makes scheme hijacking possible
26-Intent App Links, assetlinks.json and verification state
35-SSL Intercepting the back-channel token exchange
43-WebView Why the embedded user agent is dangerous, in depth
44-NetworkSecurityConfig Trusting your proxy CA so the token leg is visible
46-Tokens What happens after the flow: JWT internals, algorithm confusion, storage
47-Authentication Sessions, logout, step-up and biometrics
49-KeyStore Where a DPoP or attestation key must live
50-HardwareBackedSecurity StrongBox and key attestation
53-Frida The instrumentation used throughout §7
21-App-Sandbox The UID boundary that makes a Custom Tab safe