Class Origin
-
- All Implemented Interfaces:
public final class OriginRepresents the origin of a FIDO authentication request.
-
-
Field Summary
Fields Modifier and Type Field Description private final StringeffectiveDomainprivate final StringcallingAppprivate final Stringresolved
-
Method Summary
Modifier and Type Method Description final StringgetEffectiveDomain()Extracts the host component of resolved for use as the effective domain in RP ID validation (see Ctap2Client / Ctap1Client). final StringgetCallingApp()The origin provided by the calling application. final StringgetResolved()The resolved origin. -
-
Method Detail
-
getEffectiveDomain
final String getEffectiveDomain()
Extracts the host component of resolved for use as the effective domain in RP ID validation (see Ctap2Client / Ctap1Client).
Uses proper URI parsing instead of string manipulation so that ports (e.g.
https://example.com:8443) and paths (e.g.https://example.com/path) are stripped correctly, yielding a host-only value suitable for the RP ID comparisoneffectiveDomain == rpId || effectiveDomain.endsWith("." + rpId).Only HTTPS origins are accepted. All current call sites already guarantee that resolved is an HTTPS URL; the checks below serve as defensive assertions against future regressions. Non-hierarchical origins such as
android:apk-key-hash:…must never reach this property — they should supply the RP ID through a separate field.Error messages intentionally omit the actual origin value to avoid leaking potentially sensitive URLs into crash reporters or logs.
-
getCallingApp
final String getCallingApp()
The origin provided by the calling application.
-
getResolved
final String getResolved()
The resolved origin. Can be different from callingApp
-
-
-
-