Skip to content

Update readme to store in a more secure way the firebase token #55

Description

@boriscy

Right now the README.md show how to configure in a insecure way. The firebase token should be encrypted in rails credentials.

FIREBASE_CREDENTIALS: |
  {
    "type": "service_account",
    "project_id": "my-project-id",
    "private_key_id": "117ca4460faada333c666ff87467fe15c0c68a10",
    "private_key": "-----BEGIN PRIVATE KEY-----\nMyVeyLoingPrivateKey==\n-----END PRIVATE KEY-----\n",
    "client_email": "firebase-adminsdk-ee775@my-project.iam.gserviceaccount.com",
    "client_id": "my-client-id",
    "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-ew7t5%40project.iam.gserviceaccount.com",
    "universe_domain": "googleapis.com"
  }
# config/initializers/fcmpush.rb
require "stringio"

Fcmpush.configure do |config|
  firebase_creds = Rails.application.credentials["FIREBASE_CREDENTIALS"]
  config.json_key_io = StringIO.new(firebase_creds)
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions