Skip to content

Instantly share code, notes, and snippets.

@antonkrasov
Created May 9, 2022 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonkrasov/65681e6bb904368b79f74a250aebfc0f to your computer and use it in GitHub Desktop.
Save antonkrasov/65681e6bb904368b79f74a250aebfc0f to your computer and use it in GitHub Desktop.
const firebaseApiKey = pm.environment.get("firebaseApiKey")
const firebaseTestUserEmail = pm.environment.get("firebaseTestUserEmail")
const firebaseTestUserPassword = pm.environment.get("firebaseTestUserPassword")
const options = {
url: `https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=${firebaseApiKey}`,
method: 'POST',
header: {
'Accept': '*/*',
'Content-Type': 'application/json',
},
body: {
mode: 'raw',
raw: JSON.stringify({
"email": firebaseTestUserEmail,
"password": firebaseTestUserPassword,
"returnSecureToken": true
})
}
};
pm.sendRequest(options, function (err, res) {
const respData = res.json();
pm.environment.set("firebaseIdToken", respData.idToken);
pm.environment.set("firebaseUID", respData.localId);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment