Skip to content
This repository was archived by the owner on Apr 28, 2022. It is now read-only.

Custom authorization form

Dmitry Goroshevsky edited this page Jan 2, 2018 · 4 revisions

If you wish to integrate ShelterZoom into your own system you will need to incorporate custom authorization form inside your system's admin console.

Your custom form will need to authorize using SDK Firebase for js.

Use the following parameters to connect to ShelterZoom Property DataBase:

<script src="https://www.gstatic.com/firebasejs/4.8.1/firebase.js"></script>
<script>
  // Initialize Firebase
  var config = {
    apiKey: "AIzaSyCwNcgMsAJV-uKlqOJ1QuqLwhRBdaFIQGk",
    authDomain: "shelterzoom.firebaseapp.com",
    databaseURL: "https://shelterzoom.firebaseio.com",
    projectId: "shelterzoom",
    storageBucket: "shelterzoom.appspot.com",
    messagingSenderId: "890385557670"
  };
  firebase.initializeApp(config);
</script>

Following the successful initialization you will need to authorize using firebase.auth().signInWithEmailAndPassword(email, password).

More info about Firebase authorization could be found here

  • Getting API key

After succesfull authorization you will need an idToken.

idToken. firebase.auth().currentUser.getIdToken(true) https://firebase.google.com/docs/auth/admin/verify-id-tokens

Then call ShelterZoom Database

  • URL https://us-central1-shelterzoom.cloudfunctions.net/api/widgetInfo

  • Type GET

  • Auth Bearer via header. Example : Authorization : bearer IdToken // Received earlier

  • Success Response:

    • Code: 200
      Content: { "accessAPIToken": "a10dd8d6-5cfd-47fa-83fd-00b1d2a34123" }
  • Error Response:

    • Code: 500
      Content: { error : "description" }

The key should be used in order to submit properties into ShelterZoom Databases

Clone this wiki locally