Class RegistrationRequestFactory
java.lang.Object
org.forgerock.openig.fapi.dcr.request.RegistrationRequestFactory
A factory for creating
RegistrationRequest objects.
This class supports transforming a SignedJwt into a RegistrationRequest, which is typical of the
FAPI use case where the OAuth2.0 Dynamic Client Registration request is wrapped in a JWT signed by the client for
added security.
-
Constructor Summary
ConstructorsConstructorDescriptionRegistrationRequestFactory(JwkSetService jwkSetService, TrustedDirectoryService trustedDirectoryService, Clock clock, Duration skewAllowance, Set<JwsAlgorithm> supportedSigningAlgorithms) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreateRegistrationRequest(SignedJwt registrationRequestJwt) Creates aRegistrationRequestfrom aSignedJwt.
-
Constructor Details
-
RegistrationRequestFactory
public RegistrationRequestFactory(JwkSetService jwkSetService, TrustedDirectoryService trustedDirectoryService, Clock clock, Duration skewAllowance, Set<JwsAlgorithm> supportedSigningAlgorithms) Constructor.- Parameters:
jwkSetService- service used to retrieveJWKSetobjectstrustedDirectoryService- service used to decode software statement assertions issued by Trusted Directoriesclock- the clock to use for time-based validationskewAllowance- the amount of skew to allow when validating time-based claimssupportedSigningAlgorithms- the signing algorithms that are supported for registration requests
-
-
Method Details
-
createRegistrationRequest
public Promise<RegistrationRequest,FapiException> createRegistrationRequest(SignedJwt registrationRequestJwt) Creates aRegistrationRequestfrom aSignedJwt. These requests extend the OAuth2.0 Dynamic Client Registration protocol by wrapping the client's registration metadata in a JWT, which is then signed by the client using a key that can be obtained via their software statement.In order to trust the registration request, the
SoftwareStatementmust first be decoded and validated to verify that it was issued by a Trusted Directory that we support, this then allows us to retrieve the client'sJWKSetwhich can be used verify the registration request JWT.- Parameters:
registrationRequestJwt- the aSignedJwtcontaining the client's OAuth2.0 Dynamic Client Registration metadata as claims- Returns:
- a Promise containing the
RegistrationRequestif theregistrationRequestJwtrepresents a valid registration request, or anFapiExceptionif the JWT is invalid.
-