Currently, the OAuth 2.0 code does not handle any client secret. A workaround is to pass it as a param to the fetchAccessTokenFromAuthorizationCode method:
const tokens = await Nuxeo.oauth2.fetchAccessTokenFromAuthorizationCode(
NUXEO_BASE_URL,
NUXEO_OAUTH_CLIENT_ID,
code,
{ client_secret: NUXEO_OAUTH_CLIENT_SECRET },
);
However, the automatic refresh of the token won't work as the JS Client does not handle the secret.
We need to rework the OAuth 2.0 methods to handle an optional client secret in all cases.