I'm trying to deploy my webapp to firebase via a bitbucket pipeline and I'm encountering this error "HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential"

In my pipeline I've specified three variables: $KEY_FILE $FIREBASE_TOKEN $FIREBASE_PROJECT. The Keyfile is supposed to be a base64 encrypted json key. I used https://www.base64encode.org/ to encode it but I don't know if that works. I also have in the webapp a firebase json file which looks like this atm

{
  "hosting": {
    "public": "src",
    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
  }
}

Maybe there is some authentication that needs to be present there? Any help is appreciated. I've been using google but haven't stumbled upon a solution yet.

Pipeline yaml:


image: node:10.15.3

pipelines:
  default:
    - parallel:
        - step:
            name: Build and Test
            caches:
              - node
            script:
              - npm install
        - step:
            name: Build
            script:
              - npm install && npm run build
            artifacts:
              - build/**
        - step:
            name: Deploy to Firebase
            deployment: production
            script:
              - pipe: atlassian/firebase-deploy:0.2.1
                variables:
                    KEY_FILE: $KEY_FILE
                    FIREBASE_TOKEN: $FIREBASE_TOKEN
                    PROJECT_ID: $FIREBASE_PROJECT 
    

0

There are 0 best solutions below