Why do contents only show up for one user at a time while using firebase authentication?












0















I want to know why do contents only show up for one user at a time.



For example: if personA@gmail.com is logged in, uploads a file on the browser with the intention that other users are able to see it and afterwards, personA@gmail.com decide to logout for whatever reason. Now, personB@gmail.com logs in. How can you make it where, when logged in, personB@gmail.com can see the content personA@gmail.com uploaded (the file)?



I'm not too sure what to search hence why I'm asking this here.



Security file below:



service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if true;
}
}
}









share|improve this question

























  • Can you share your security rules file?

    – Jonathan
    Jan 2 at 0:55











  • @Jonathan Sure, I'd love to but where can I find that?

    – greyskies
    Jan 2 at 0:56













  • If you goto the firebase console -> Storage -> Rules. This is where you can set all the rules for security of the storage

    – Jonathan
    Jan 2 at 0:58











  • Please update your question with the rules and the structure you are saving the files and retrieve the files.

    – Jonathan
    Jan 2 at 0:59











  • @Jonathan Done. I posted the security rules file.

    – greyskies
    Jan 2 at 1:01
















0















I want to know why do contents only show up for one user at a time.



For example: if personA@gmail.com is logged in, uploads a file on the browser with the intention that other users are able to see it and afterwards, personA@gmail.com decide to logout for whatever reason. Now, personB@gmail.com logs in. How can you make it where, when logged in, personB@gmail.com can see the content personA@gmail.com uploaded (the file)?



I'm not too sure what to search hence why I'm asking this here.



Security file below:



service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if true;
}
}
}









share|improve this question

























  • Can you share your security rules file?

    – Jonathan
    Jan 2 at 0:55











  • @Jonathan Sure, I'd love to but where can I find that?

    – greyskies
    Jan 2 at 0:56













  • If you goto the firebase console -> Storage -> Rules. This is where you can set all the rules for security of the storage

    – Jonathan
    Jan 2 at 0:58











  • Please update your question with the rules and the structure you are saving the files and retrieve the files.

    – Jonathan
    Jan 2 at 0:59











  • @Jonathan Done. I posted the security rules file.

    – greyskies
    Jan 2 at 1:01














0












0








0








I want to know why do contents only show up for one user at a time.



For example: if personA@gmail.com is logged in, uploads a file on the browser with the intention that other users are able to see it and afterwards, personA@gmail.com decide to logout for whatever reason. Now, personB@gmail.com logs in. How can you make it where, when logged in, personB@gmail.com can see the content personA@gmail.com uploaded (the file)?



I'm not too sure what to search hence why I'm asking this here.



Security file below:



service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if true;
}
}
}









share|improve this question
















I want to know why do contents only show up for one user at a time.



For example: if personA@gmail.com is logged in, uploads a file on the browser with the intention that other users are able to see it and afterwards, personA@gmail.com decide to logout for whatever reason. Now, personB@gmail.com logs in. How can you make it where, when logged in, personB@gmail.com can see the content personA@gmail.com uploaded (the file)?



I'm not too sure what to search hence why I'm asking this here.



Security file below:



service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if true;
}
}
}






javascript reactjs firebase firebase-storage






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 3:26







greyskies

















asked Jan 2 at 0:45









greyskiesgreyskies

9517




9517













  • Can you share your security rules file?

    – Jonathan
    Jan 2 at 0:55











  • @Jonathan Sure, I'd love to but where can I find that?

    – greyskies
    Jan 2 at 0:56













  • If you goto the firebase console -> Storage -> Rules. This is where you can set all the rules for security of the storage

    – Jonathan
    Jan 2 at 0:58











  • Please update your question with the rules and the structure you are saving the files and retrieve the files.

    – Jonathan
    Jan 2 at 0:59











  • @Jonathan Done. I posted the security rules file.

    – greyskies
    Jan 2 at 1:01



















  • Can you share your security rules file?

    – Jonathan
    Jan 2 at 0:55











  • @Jonathan Sure, I'd love to but where can I find that?

    – greyskies
    Jan 2 at 0:56













  • If you goto the firebase console -> Storage -> Rules. This is where you can set all the rules for security of the storage

    – Jonathan
    Jan 2 at 0:58











  • Please update your question with the rules and the structure you are saving the files and retrieve the files.

    – Jonathan
    Jan 2 at 0:59











  • @Jonathan Done. I posted the security rules file.

    – greyskies
    Jan 2 at 1:01

















Can you share your security rules file?

– Jonathan
Jan 2 at 0:55





Can you share your security rules file?

– Jonathan
Jan 2 at 0:55













@Jonathan Sure, I'd love to but where can I find that?

– greyskies
Jan 2 at 0:56







@Jonathan Sure, I'd love to but where can I find that?

– greyskies
Jan 2 at 0:56















If you goto the firebase console -> Storage -> Rules. This is where you can set all the rules for security of the storage

– Jonathan
Jan 2 at 0:58





If you goto the firebase console -> Storage -> Rules. This is where you can set all the rules for security of the storage

– Jonathan
Jan 2 at 0:58













Please update your question with the rules and the structure you are saving the files and retrieve the files.

– Jonathan
Jan 2 at 0:59





Please update your question with the rules and the structure you are saving the files and retrieve the files.

– Jonathan
Jan 2 at 0:59













@Jonathan Done. I posted the security rules file.

– greyskies
Jan 2 at 1:01





@Jonathan Done. I posted the security rules file.

– greyskies
Jan 2 at 1:01












1 Answer
1






active

oldest

votes


















0














For adjusting the security of the rules which you will want to do for a situation like this. To lock down the files to only authenticated users, use this:



service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth!=null;
}
}
}


There are also some great documents here Storage Security Documentation






share|improve this answer
























  • So with the snippet you just provided, that would satisfy the scenario that I'm referring to, corrent?

    – greyskies
    Jan 2 at 1:05











  • The code I provided is only for the security of allowing authenticated users to see files. From your question it sounds like you are wanting User B to see User A's files. Most likely it is an issue of what path you are using to read the files. From your updated code sample I can't tell what that path is.

    – Jonathan
    Jan 2 at 3:08











  • Yeah so you mean with the security code you provided, authenticated users can now see each others uploads and the security code that I provided disallows this, correct?

    – greyskies
    Jan 2 at 3:15











  • Your security rules allowed unauthorized users to upload and read files.

    – Jonathan
    Jan 2 at 3:16











  • ok got it, so what does your security rules exactly do? allows only authenticated to see uploaded files, right?

    – greyskies
    Jan 2 at 3:17











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54000097%2fwhy-do-contents-only-show-up-for-one-user-at-a-time-while-using-firebase-authent%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














For adjusting the security of the rules which you will want to do for a situation like this. To lock down the files to only authenticated users, use this:



service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth!=null;
}
}
}


There are also some great documents here Storage Security Documentation






share|improve this answer
























  • So with the snippet you just provided, that would satisfy the scenario that I'm referring to, corrent?

    – greyskies
    Jan 2 at 1:05











  • The code I provided is only for the security of allowing authenticated users to see files. From your question it sounds like you are wanting User B to see User A's files. Most likely it is an issue of what path you are using to read the files. From your updated code sample I can't tell what that path is.

    – Jonathan
    Jan 2 at 3:08











  • Yeah so you mean with the security code you provided, authenticated users can now see each others uploads and the security code that I provided disallows this, correct?

    – greyskies
    Jan 2 at 3:15











  • Your security rules allowed unauthorized users to upload and read files.

    – Jonathan
    Jan 2 at 3:16











  • ok got it, so what does your security rules exactly do? allows only authenticated to see uploaded files, right?

    – greyskies
    Jan 2 at 3:17
















0














For adjusting the security of the rules which you will want to do for a situation like this. To lock down the files to only authenticated users, use this:



service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth!=null;
}
}
}


There are also some great documents here Storage Security Documentation






share|improve this answer
























  • So with the snippet you just provided, that would satisfy the scenario that I'm referring to, corrent?

    – greyskies
    Jan 2 at 1:05











  • The code I provided is only for the security of allowing authenticated users to see files. From your question it sounds like you are wanting User B to see User A's files. Most likely it is an issue of what path you are using to read the files. From your updated code sample I can't tell what that path is.

    – Jonathan
    Jan 2 at 3:08











  • Yeah so you mean with the security code you provided, authenticated users can now see each others uploads and the security code that I provided disallows this, correct?

    – greyskies
    Jan 2 at 3:15











  • Your security rules allowed unauthorized users to upload and read files.

    – Jonathan
    Jan 2 at 3:16











  • ok got it, so what does your security rules exactly do? allows only authenticated to see uploaded files, right?

    – greyskies
    Jan 2 at 3:17














0












0








0







For adjusting the security of the rules which you will want to do for a situation like this. To lock down the files to only authenticated users, use this:



service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth!=null;
}
}
}


There are also some great documents here Storage Security Documentation






share|improve this answer













For adjusting the security of the rules which you will want to do for a situation like this. To lock down the files to only authenticated users, use this:



service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth!=null;
}
}
}


There are also some great documents here Storage Security Documentation







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 2 at 1:04









JonathanJonathan

9332932




9332932













  • So with the snippet you just provided, that would satisfy the scenario that I'm referring to, corrent?

    – greyskies
    Jan 2 at 1:05











  • The code I provided is only for the security of allowing authenticated users to see files. From your question it sounds like you are wanting User B to see User A's files. Most likely it is an issue of what path you are using to read the files. From your updated code sample I can't tell what that path is.

    – Jonathan
    Jan 2 at 3:08











  • Yeah so you mean with the security code you provided, authenticated users can now see each others uploads and the security code that I provided disallows this, correct?

    – greyskies
    Jan 2 at 3:15











  • Your security rules allowed unauthorized users to upload and read files.

    – Jonathan
    Jan 2 at 3:16











  • ok got it, so what does your security rules exactly do? allows only authenticated to see uploaded files, right?

    – greyskies
    Jan 2 at 3:17



















  • So with the snippet you just provided, that would satisfy the scenario that I'm referring to, corrent?

    – greyskies
    Jan 2 at 1:05











  • The code I provided is only for the security of allowing authenticated users to see files. From your question it sounds like you are wanting User B to see User A's files. Most likely it is an issue of what path you are using to read the files. From your updated code sample I can't tell what that path is.

    – Jonathan
    Jan 2 at 3:08











  • Yeah so you mean with the security code you provided, authenticated users can now see each others uploads and the security code that I provided disallows this, correct?

    – greyskies
    Jan 2 at 3:15











  • Your security rules allowed unauthorized users to upload and read files.

    – Jonathan
    Jan 2 at 3:16











  • ok got it, so what does your security rules exactly do? allows only authenticated to see uploaded files, right?

    – greyskies
    Jan 2 at 3:17

















So with the snippet you just provided, that would satisfy the scenario that I'm referring to, corrent?

– greyskies
Jan 2 at 1:05





So with the snippet you just provided, that would satisfy the scenario that I'm referring to, corrent?

– greyskies
Jan 2 at 1:05













The code I provided is only for the security of allowing authenticated users to see files. From your question it sounds like you are wanting User B to see User A's files. Most likely it is an issue of what path you are using to read the files. From your updated code sample I can't tell what that path is.

– Jonathan
Jan 2 at 3:08





The code I provided is only for the security of allowing authenticated users to see files. From your question it sounds like you are wanting User B to see User A's files. Most likely it is an issue of what path you are using to read the files. From your updated code sample I can't tell what that path is.

– Jonathan
Jan 2 at 3:08













Yeah so you mean with the security code you provided, authenticated users can now see each others uploads and the security code that I provided disallows this, correct?

– greyskies
Jan 2 at 3:15





Yeah so you mean with the security code you provided, authenticated users can now see each others uploads and the security code that I provided disallows this, correct?

– greyskies
Jan 2 at 3:15













Your security rules allowed unauthorized users to upload and read files.

– Jonathan
Jan 2 at 3:16





Your security rules allowed unauthorized users to upload and read files.

– Jonathan
Jan 2 at 3:16













ok got it, so what does your security rules exactly do? allows only authenticated to see uploaded files, right?

– greyskies
Jan 2 at 3:17





ok got it, so what does your security rules exactly do? allows only authenticated to see uploaded files, right?

– greyskies
Jan 2 at 3:17




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54000097%2fwhy-do-contents-only-show-up-for-one-user-at-a-time-while-using-firebase-authent%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

'app-layout' is not a known element: how to share Component with different Modules

android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

WPF add header to Image with URL pettitions [duplicate]