Enterprise
The SignServer REST API supports OAuth 2.0 user authorization in place of certificate-based authorization by using a bearer token authorization header in a JSON Web Token (JWT) format. The JWT header is the first part of a JSON Web Token that holds metadata explaining how the token is signed and structured. OAuth 2.0 authorization is supported for all Admin API operations and for Client API operations if a JWT Authorizer is configured.
When a JWT is provided in a REST request as an Authorization: Bearer header, the token is parsed, validated, and determined to be an authorized call based on the roles in the payload. If an Authorization: Bearer header is provided in the request, this authorization method takes precedence over certificate-based authorization.
Benefits of OAuth 2.0 authorization include reusing the authentication received from an Identity Provider (IdP) to control role-based actions of users and administrators. For example, after completing the necessary configuration in your IdP and in SignServer, you can manage user roles through the OAuth 2.0 authorization framework. Using OAuth 2.0 can reduce the management of certificates used for SignServer.
Mechanics of Authorization
A valid Authorization: Bearer token should be JWT-formatted and base64url-encoded. The JWT is separated by periods (.) and consists of a header, a payload, and a signature.
Example of a correctly formatted JWT Bearer token:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3OTM3OTcyODUsImV4cCI6MTc5MzgwMTUzOCwic3ViIjoidGVzdC11c2VyIiwiaXNzIjoidGVzdC1pZHAiLCJhdWQiOlsiU2lnblNlcnZlciJdLCJyb2xlcyI6WyJhZG1pbiIsImF1ZGl0b3IiXX0.IzI2isiRQGD3cTnM8NHbAT2H-JtULt5TTS9QOMgSRWk
The following displays the header and payload for the above token:
Header
{
"alg": "HS256",
"typ": "JWT"
}
Payload
{
"iat": 1793797285,
"exp": 1793801538,
"sub": "test-user",
"iss": "test-idp",
"aud": [
"SignServer"
],
"roles": [
"admin",
"auditor"
]
}
Set up Your Provider
Configure your IdP with the following requirements:
-
Create a claim holding at least one of the following supported roles:
admin,auditor, andarchive_auditor. Assign the applicable roles to each user. The claim name must match thejwt.callerGroupClaimsvalue in the following JWT properties. -
Ensure the
audclaim of the access token contains at least one of the audience values fromjwt.acceptedAudiencesin the following JWT properties.
In order to enable administrator actions, a user must have the admin role.
For the JWT-based authorization to extract the issuer and the JWKS URL, your IdP must support the standard OpenID Connect (OIDC) Discovery URL .well-known/openid-configuration. If not supported, see the Optional Configuration for an alternative.
Configure JWT Properties
Unlike the JWT Authorizer, which operates on a Worker level, a jwt.properties file in SignServer needs to be configured with your provider information. After configuration, SignServer trusts your provider, accepts the access tokens issued, and authorizes role-specific actions in the API.
Configure the jwt.properties file:
-
Set the
providerUrito the domain URL:
jwt.providerUri=https://<domain>/
The providerUri performs a discovery check using the /.well-known/openid-configuration endpoint to extract an issuer and the JSON Web Key Set (JWKS) URL.
-
Set the
callerGroupClaimsto the same roles claim name in the IdP:
jwt.callerGroupClaims=ExampleRolesClaim
-
Set the
acceptedAudiencesto include one or more of theaudvalues in the IdP:
jwt.acceptedAudiences=ExampleAudience
Optional Configuration
You can optionally configure the issuer and JWKS URL directly into the jwt.properties file.
Use the following property names and fill in the correct values that corresponds to the valid issuer and jwksUri values:
jwt.issuer=Example-Issuer
jwt.jwksUri=https://<domain>/<jwks path>
If the issuer and jwksUri properties are configured, the discovery call to /.well-known/openid-configuration will not be performed, which means that correctly configuring the values is crucial for successful authorization.