Aura RCS development troubleshooting

Resolution of common problems, fixes and enhancements when developing a use case in aura-bridge RCS

Configuring a new channel

Issue with configured RCS APIKey

How to detect it

An error with the configured RCS APIKey is occurring if your RCS messages do not arrive to the destination and you find this error in your logs:

ERROR Error on controller method {
        module: 'aura-push-incoming-controller',
        error: 'error:1E08010C:DECODER routines::unsupported',
        stck: Error: error:1E08010C:DECODER routines::unsupported
            at Sign.sign (node:internal/crypto/sig:128:29)
            at Object.sign (/home/id04828/auraProjects/aura-bridge/node_modules/jwa/index.js:152:45)
            at Object.jwsSign [as sign] (/home/id04828/auraProjects/aura-bridge/node_modules/jws/lib/sign-stream.js:32:24)
            at GoogleToken._GoogleToken_requestToken (/home/id04828/auraProjects/aura-bridge/node_modules/gtoken/build/src/index.js:235:27)
            at GoogleToken._GoogleToken_getTokenAsyncInner (/home/id04828/auraProjects/aura-bridge/node_modules/gtoken/build/src/index.js:180:97)
            at GoogleToken._GoogleToken_getTokenAsync (/home/id04828/auraProjects/aura-bridge/node_modules/gtoken/build/src/index.js:160:173)
            at GoogleToken.getToken (/home/id04828/auraProjects/aura-bridge/node_modules/gtoken/build/src/index.js:110:102)
            at JWT.refreshTokenNoCache (/home/id04828/auraProjects/aura-bridge/node_modules/google-auth-library/build/src/auth/jwtclient.js:173:36)
            at JWT.refreshToken (/home/id04828/auraProjects/aura-bridge/node_modules/google-auth-library/build/src/auth/oauth2client.js:187:24)
            at JWT.getRequestMetadataAsync (/home/id04828/auraProjects/aura-bridge/node_modules/google-auth-library/build/src/auth/oauth2client.js:333:28) {
          library: 'DECODER routines',
          reason: 'unsupported',
          code: 'ERR_OSSL_UNSUPPORTED'
        },
        corr: '078ee5cf-2b9d-4fb6-9268-c9c5685232f8',
        version: '9.7.0',
        app: 'aura-bridge',
        host: 'ph'
      }

How to solve it

To solve this issue, the rcs.privateKey field of channel configuration must be correctly configured in base64 format.

To obtain the correctly formatted value, you can execute the following code:

const privateKey = `-----BEGIN PRIVATE KEY-----
    YOUR_PRIVATE_KEY
-----END PRIVATE KEY-----`

console.log(Buffer.from(privateKey, 'utf8').toString('base64'));