Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebase Auth Emulator JWT token signature missing #536

Open
Polyrion opened this issue Dec 5, 2021 · 0 comments
Open

Firebase Auth Emulator JWT token signature missing #536

Polyrion opened this issue Dec 5, 2021 · 0 comments

Comments

@Polyrion
Copy link

Polyrion commented Dec 5, 2021

Describe the bug

The issue occurs when I'm making an authentification with firebase auth on a phone number + uid then a code verification
http://localhost:9099/emulator/v1/projects/project-id/verificationCodes
everything working well but when I want to validate the sign in account with spree backend the jwt token is not complete the signature part is missing and I got a 403 on my request.

command.js

const fbConfig = {
  apiKey: 'YOUR_API_KEY',
  authDomain: 'YOUR_AUTH_DOMAIN',
  databaseURL: 'YOUR_URL',
  projectId: 'YOUR_PROJECT_ID',
  storageBucket: 'YOUR_BUCKET',
  messagingSenderId: 'YOUR_SENDER_ID',
  appId: 'YOUR_APPID',
  measurementId: 'YOUR_MEASUREMENT_ID',
  serviceAccountId: 'YOUR_SERVICE_ACCOUNT_ID',
}

const authEmulatorHost = Cypress.env('FIREBASE_AUTH_EMULATOR_HOST')

if (firebase.apps?.length === 0 && authEmulatorHost) {
  firebase.initializeApp(fbConfig)
  firebase.auth().useEmulator(`http://${authEmulatorHost}/`)
  console.debug(`Using Auth emulator: http://${authEmulatorHost}/`)
}

attachCustomCommands({ Cypress, cy, firebase })

signant.spec


/// <reference types="cypress" />

describe('Can access Home and Sign in to see his profile', () => {
  before(() => {
    cy.login('TEST_UID', {
      phone_number: '+33111111111',
    })
  })
  it('can visit home and go to profile page', () => {
    cy.visit('/')
    cy.get('div[data-testid="profile"]').parent().click()
  })
})

Whatever I try cy.login() or manually test the login with action I still got an incomplete JWT token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant