Invalid PKCS#8 data. - IOException

cristianormoraes8 months ago

Hi, I'm trying to configure Firebase Messaging but I'm got the error bellow:

Invalid PKCS#8 data. - IOException (... < NotificatorFirebase:79 < <gener:-1 < *:-1 < ... < NotificatorManager:70 < ...)

I dont know if I put some wrong data, I cant find in the forum useful help.

My config entry:

    <entry key='notificator.firebase.serviceAccount'>
    {
      "type": "service_account",
      "project_id": "safer-app",
      "private_key_id": "DzW3nGy8ky______________2tE2_zYFkjMrg",
      "private_key": "-----BEGIN PRIVATE KEY-----AAAAZwA4epk:APA91bEOZtS60HVqI5pINE________________32VBKhwBPqJyC-YrfOq966FumqsGvMzQ2MtFAMktyQrdAxAFEn0NmkH_thtN8h3pmvwPmQ6pFl1p8BTkK2zFdN7HuuywP-----END PRIVATE KEY-----\n",
      "client_email": "firebase-adminsdk-_____@___.iam.gserviceaccount.com",
      "client_id": "11473669______7834632",
      "auth_uri": "https://accounts.google.com/o/oauth2/auth",
      "token_uri": "https://oauth2.googleapis.com/token",
      "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
      "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-_____@___.iam.gserviceaccount.com"
    }
    </entry>
Anton Tananaev8 months ago

There must be some issue with the service account. If there are some special characters, they need to be escaped to make it a valid XML file.