java.lang.Object
com.irurueta.authserver.serviceclient.infrastructure.resourceserver.DPoPProofs

public class DPoPProofs extends Object
Creates the DPoP proofs (RFC 9449) of the service client. Spring Security has no client-side DPoP support, so the proofs are made with Nimbus' DPoPProofFactory, signed with a key pair that lives as long as the process.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final com.nimbusds.oauth2.sdk.dpop.DPoPProofFactory
    Creates and signs the proofs.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    proof(String method, URI uri)
    Creates the proof of a token request: it binds the request, not yet any token.
    proof(String method, URI uri, String accessToken)
    Creates the proof of a call that carries an access token: it also binds the token (ath claim).
    private static URI
    Removes the query and the fragment, which htu does not include.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • proofFactory

      private final com.nimbusds.oauth2.sdk.dpop.DPoPProofFactory proofFactory
      Creates and signs the proofs.
  • Constructor Details

    • DPoPProofs

      public DPoPProofs()
  • Method Details

    • proof

      public String proof(String method, URI uri)
      Creates the proof of a token request: it binds the request, not yet any token.
      Parameters:
      method - HTTP method of the request.
      uri - URI of the request.
      Returns:
      the serialized proof JWT.
      Throws:
      IllegalStateException - if the proof cannot be signed.
    • proof

      public String proof(String method, URI uri, String accessToken)
      Creates the proof of a call that carries an access token: it also binds the token (ath claim).
      Parameters:
      method - HTTP method of the request.
      uri - URI of the request.
      accessToken - value of the access token the request carries.
      Returns:
      the serialized proof JWT.
      Throws:
      IllegalStateException - if the proof cannot be signed.
    • withoutQuery

      private static URI withoutQuery(URI uri)
      Removes the query and the fragment, which htu does not include.
      Parameters:
      uri - the URI of the request.
      Returns:
      the URI as the proof states it.