1.0.7 • Published 5 years ago

parse-firebase-adapter v1.0.7

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

Parse-server-firebase-auth-adapter

Authenticate to parse server with your Firebase account

How to use it?

1) Install the module

npm i -S parse-firebase-adapter

2) Add environment variables

  • Copy the firebaseAccountKey.json from Firebase into your folder, maybe root of your project's folder.
  • Add new environment into your .env or using export in your terminal.
// firebaseAccountKey.json store in root of project.
FIREBASE_SERVICE_ACCOUNT_KEY = '../../firebaseAccountKey.json'

// URL for connect to Firebase database.
FIREBASE_DATABASE_URL = "https://SOME_ID.firebaseio.com"

// parse server provider
PARSE_SERVER_AUTH_PROVIDERS = "{\"firebase\": {\"module\": \"parse-firebase-adapter\"}}"

3) Add this module when creating ParseServer

import { ParseServer } from 'parse-server'
import firebaseAuthAdapter from 'parse-firebase-adapter'
...
const parserServer = new ParseServer({
  ...
  auth: {
    firebase: firebaseAuthAdapter
  }
})

4) Using Firebase access token in our project

  • Get Parse access token by POST a raw data to /parse/users
curl -X POST \
  {{host}}/parse/users \
  -H 'content-type: application/json' \
  -H 'x-parse-application-id: {{ParseAppId}}' \
  -d '{
    "authData": {
    	"firebase": {
    		"access_token": "{{access_token}}",
    		"id": "{{FirebaseUID}}"
    	}
    }
}'
1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago