Interface TokenTrust

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TokenTrust
Decides whether the token in an offer's identity assertion is trusted.

This is only the first half of validating an offer. Whichever policy is chosen, the assertion's detached JWS over the SDP fingerprints is still verified against the token's cpk, which is what ties the identity to the DTLS certificate the peer presents.

See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    Holder so the shared consumer is built once.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TokenTrust
    Reads the claims without checking who signed the token, for peers that cannot present a Minecraft-issued one, such as another proxy in the same fleet.
    static final TokenTrust
    Verifies the token against Minecraft's authorization service, which is what a retail client presents.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.jose4j.jwt.JwtClaims
    claims(Identity identity)
     
  • Field Details

    • MINECRAFT_AUTH

      static final TokenTrust MINECRAFT_AUTH
      Verifies the token against Minecraft's authorization service, which is what a retail client presents. This is the default.
    • ANY

      static final TokenTrust ANY
      Reads the claims without checking who signed the token, for peers that cannot present a Minecraft-issued one, such as another proxy in the same fleet.

      The cpk binding still applies, so the peer must hold the key its token names, and the token must carry an expiry and be within it. Neither bounds what the token says: the peer signs its own, so xid, xname and the expiry itself are whatever it chose. Nothing here establishes who the peer is, so pair it with an identity check of your own.

  • Method Details

    • claims

      org.jose4j.jwt.JwtClaims claims(Identity identity) throws Exception
      Parameters:
      identity - The identity taken from the offer
      Returns:
      The token's claims, which must include cpk
      Throws:
      Exception - If the token is not trusted