Class Origin

  • All Implemented Interfaces:

    
    public final class Origin
    
                        

    Represents the origin of a FIDO authentication request.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      Origin(String callingApp, String resolved)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String getEffectiveDomain() Extracts the host component of resolved for use as the effective domain in RP ID validation (see Ctap2Client / Ctap1Client).
      final String getCallingApp() The origin provided by the calling application.
      final String getResolved() The resolved origin.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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 comparison effectiveDomain == 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.

      • getResolved

         final String getResolved()

        The resolved origin. Can be different from callingApp