protected String signTokenIfNecessary(final JwtClaims claims, final OAuthRegisteredService registeredService) throws Throwable {
        if (shouldSignToken(registeredService)) {
            LOGGER.debug("Fetching JSON web key to sign the token for : [{}]", registeredService.getClientId());
            val jsonWebKey = getJsonWebKeySigningKey(Optional.of(registeredService));
            LOGGER.debug("Found JSON web key to sign the token: [{}]", jsonWebKey);
            Objects.requireNonNull(jsonWebKey.getPrivateKey(), "JSON web key used to sign the token has no associated private key");
            return signToken(registeredService, claims, jsonWebKey);
        }
        val claimSet = JwtBuilder.parse(claims.toJson());
        return JwtBuilder.buildPlain(claimSet, Optional.of(registeredService));
    }
Gets allowed signing algorithms.
Returning an empty collection indicates that all algorithms should be supported, except none.

@param registeredService the svc
@return the allowed signing algorithms
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/ticket/BaseTokenSigningAndEncryptionService.java