Package com.irurueta.authserver.authorization.api.web.x509


package com.irurueta.authserver.authorization.api.web.x509
X.509 client certificate authentication: a certificate presented on a dedicated TLS port, or forwarded by a trusted reverse proxy in a header, signs in the user it is bound to (by the SHA-256 fingerprint of the certificate) at POST /login/x509, the form of the login page, with the CSRF token. Everything is off unless authserver.x509.enabled is true.
  • Class
    Description
    The trust manager of the dedicated TLS port: it accepts any client certificate and advertises no certificate authority.
    Manages the client certificates bound to the authenticated account (the operations of the contract).
    Maps the certificate bindings of the domain onto the DTO generated from the contract.
    Answers the failures of the certificates API as application/problem+json.
    Takes the SHA-256 fingerprint of the client certificate as the principal, as 64 lower case hexadecimal digits, which is what a binding stores and what ResolveCertificateLoginUseCase looks up.
    Provides the server certificate of the dedicated TLS port when the dev profile is active and none is configured, so a developer does not have to create one: a self-signed certificate for localhost is generated once per machine with the JDK's keytool, stored in a key store under ~/.irurueta-auth-server/ that only the owner can read (its password in a file next to it, as DevKeyEncryptionSecret keeps its secret) and reused at every start.
    Reads the client certificate a reverse proxy that terminates TLS forwards in a header and leaves it where the servlet container leaves a certificate of its own, in the jakarta.servlet.request.X509Certificate request attribute, so the same X.509 filter and principal extractor serve both transports.
    Thrown when the value sent to bind a certificate is not a single PEM X.509 certificate within its validity period.
    Reads the certificate sent to bind it to an account: exactly one X.509 certificate in PEM form, within its validity period, with a subject.
    What a binding keeps of a certificate sent to the account API: its fingerprint, which identifies it, and its subject, which only tells the bindings apart.
    Completes a sign-in with a client certificate.
    Adds the sign-in with a client certificate to the login/UI chain through http.x509(...).
    Hands the session authentication strategy of the chain to the success handler.
    Installs the sign-in with a client certificate in the login/UI chain, only while authserver.x509.enabled is true.
    Registers the client certificate as an authentication factor: a strong primary one, because the holder proves possession of the private key during the TLS handshake (or the proxy did on the server's behalf), so a certificate satisfies the multi-factor policy on its own.
    Refuses to start when a certificate may be forwarded in a header while the server rewrites the address of its clients from the forwarded headers.
    The X.509 filter of the sign-in path.
    Contributes the sign-in with a client certificate to the login page: a form with one button that posts, with the CSRF token, to POST /login/x509.
    Configuration of the sign-in with a client certificate (authserver.x509.*).
    Adds the dedicated TLS port that requests a client certificate, when authserver.x509.port is set.
    The key store that holds the server certificate of the dedicated TLS port.
    Decides which key store holds the server certificate of the dedicated TLS port: the configured one or, under the dev profile and with none configured, the generated one.
    Loads the account a client certificate is bound to.