Step 3: Signing Authorization

Hash Signing PAR Request

 This request creates an authorization request bound to a specific signing credential, hash algorithm, and one or more document hashes.
 

HTTP Request

POST {{csc_base_url}}/oauth2/pushed_authorize
Authorization: Basic BASE64(client_id:client_secret)
Content-Type: application/x-www-form-urlencoded
 
response_type=code
client_id={{client_id}}
redirect_uri={{redirect_uri}}
scope=credential
state={{oauth_state}}
credentialID={{credential_id}}
numSignatures=1
hashes={{hash_base64}}
hashAlgorithmOID={{hash_algorithm_oid}}
acr_values={{acr_values}}
code_challenge_method=S256
code_challenge={{code_challenge}}

 

Input Parameters

ParameterLocationRequiredType/FormatDescription
AuthorizationHeaderYesHTTP BasicOAuth client authentication
response_typeFormYesStringStatic value code
client_idFormYesStringOAuth client identifier
redirect_uriFormYesURIRegistered callback URL
scopeFormYesStringStatic value credential
stateFormYesStringNew correlation/CSRF value for this signing attempt
credentialIDFormYesStringThe signing credential to be used for signing
numSignaturesFormYesPositive IntegerNumber of signatures; must match the number of hashes
hashesFormYes, if SCAL=2Standard Base64 valuesHashes to be signed; multiple values may be supplied according to the RSE format
hashAlgorithmOIDFormYesOID StringFor SHA-384 use 2.16.840.1.101.3.4.2.2
acr_valuesFormRecommendedStringRestricts the authentication methods offered to the user. For this service, specify the eID Card and/or eID Scan authentication flows. Multiple values are separated by a pipe character | , URL-encoded as %7C`.
code_challenge_methodFormYesStringS256
code_challengeFormYesBase64URL without paddingCalculated from the new signing flow code_verifier

 The response structure is identical to the credential PAR request:

{
"request_uri": "urn:ietf:params:oauth:request_uri:<identifier>",
"expires_in": 60
}

Create a new authorize_url from the returned request_uri and perform signing approval in the browser.

The callback state parameter must be validated against the oauth_state generated specifically for this signing flow.

The request supports Single Sign-On (SSO). Therefore, user authentication is not required again if a valid authentication session already exists. However, signing approval is required for every signing operation.

Exchange the Signing Authorization Code for a Token

This request exchanges the authorization code received after signing approval for a short-lived Bearer token bound to the authorized hash values.

HTTP Request

POST {{csc_base_url}}/oauth2/token
Authorization: Basic BASE64(client_id:client_secret)
Content-Type: application/x-www-form-urlencoded
 
grant_type=authorization_code
client_id={{client_id}}
code={{authorization_code}}
redirect_uri={{redirect_uri}}
code_verifier={{code_verifier}}

 

Input Parameters

The input parameters are identical to those described in the Authorization Code Exchange section.
Use the new authorization_code received during the signing flow together with the code_verifier generated specifically for that signing flow, rather than the values used during the credential acquisition flow.
 

Response Example


{
"access_token": "<redacted>",
"token_type": "Bearer",
"expires_in": 120,
"authorization_details": [
{
"type": "digest_signing",
"digests": [
{
"value": "<SHA-384-hash-in-Base64>",
"algorithm": "SHA-384"
}
],
"sign_identity_id": "<credential-id>",
"num_signatures": 1
}
]
}

 

Response Parameters and Validation

 

ParameterTypeDescriptionIntegrator Validation
access_tokenStringBearer access token issued for this specific signing operationUse immediately with signatures/signHash
token_typeStringToken typeExpected value is Bearer
expires_inNumberValidity period in secondsDo not use after expiration
authorization_details[].typeStringAuthorization typeExpected value is digest_signing
authorization_details[].digests[].valueStringAuthorized hash value in Base64 formatMust exactly match the hashes value submitted in the PAR request
authorization_details[].digests[].algorithmStringHash algorithm nameExpected value for this profile is SHA-384
authorization_details[].sign_identity_idStringAuthorized signing credential identifierMust match the intended credential_id
authorization_details[].num_signaturesNumberAuthorized number of signaturesMust match the PAR numSignatures value and the number of hashes
 
⚠️

Important

 
Before calling signHash, the integrator must verify that the values of digests.value, the hash algorithm, credential_id, and num_signatures contained in the token exactly match the values approved by the user during the PAR/authorization flow.


Did this page help you?