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 custom token auth #1891

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Umair-Manzoor-47
Copy link
Contributor

Github Ticket : #1703

  1. Send credentials to backend.
  2. onComplete auth from backend send token to this signInWithCustomAuth Action.
  3. it Signs in Existing User if already exists or Creates a new one if User doesn't exists already.
  4. User is now Authenticated and Signed in on firebase.
    Implemented sign in with custom firebase authentication token
    signInWithCustomAuth:
      token: {firebase token form backend server}
      onAuthenticated:
        executeCode:
          body: |
            ensemble.storage.userAuthId = event.data.user.id;
            console.log("ensemble.storage.userAuthId");
          onComplete:
            executeActionGroup:
              actions:
                - showToast:
                    message: ${ensemble.storage.userAuthId}

@Umair-Manzoor-47 Umair-Manzoor-47 linked an issue Feb 26, 2025 that may be closed by this pull request
@Umair-Manzoor-47 Umair-Manzoor-47 marked this pull request as ready for review February 27, 2025 14:55
@amin-nas
Copy link
Contributor

@Umair-Manzoor-47 let's rename this to signInWithCustomToken
Also, we need to have the id token available in event.data.user. Since we will be calling secured cloud functions, we need to pass this token in the header. This token should be available for all methods of firebase auth supported by Ensemble.

@Umair-Manzoor-47
Copy link
Contributor Author

@amin-nas
For clarification
event.data.user must have tokenId sent from backend?
OR UUID that is sent from firebase after user is authenticated and signed in.
Now event.data.user already has UUID.

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

Successfully merging this pull request may close these issues.

Support for Firebase signInWithCustomToken
2 participants