Filtering User Access in Typesense with Firebase
TLDR Mateus queries about using Typesense to restrict user view by company ID. Jason suggests using scoped API keys, and generating these keys with Firebase functions. However, Mateus faces challenges with user authorization and Firebase functionality. The issue remains unresolved.
Apr 22, 2022 (21 months ago)
Mateus
01:17 PMHow can I filter by user's company ID?
Jason
01:18 PMMateus
01:37 PMJason
01:42 PMMateus
01:55 PMJason
01:56 PMMateus
02:11 PMconst typesenseInstantsearchAdapter = new
TypesenseInstantSearchAdapter({
server: {
apiKey: // scoped api key
...
Jason
02:12 PMMateus
02:48 PMJason
02:58 PMOr may be there's a separate function that just generates scoped API keys for logged in users. The FE makes calls to this function for logged in users
Mateus
03:05 PMthanks for the help dude, I really appreciated that
Jason
03:05 PMMateus
03:21 PMhttps://firebase.google.com/docs/auth/web/password-auth
Jason
03:23 PMMateus
06:43 PMMateus
06:43 PMJason
07:25 PMJason
07:25 PMMateus
07:42 PMJason
07:57 PMMateus
08:32 PMJason
08:34 PMJason
08:35 PMTypesense
Indexed 3015 threads (79% resolved)
Similar Threads
Firebase Auth with Typesense Extension for Firestore.
DomijKu seeks ways to handle Firebase Auth with Typesense for Firestore, aiming to restrict search based on user roles and log-in status. Jason provides guidance, suggesting the use of scoped API keys, Google Cloud functions for verifying Firebase Auth, and storing user-specific information in each record.
Trouble with Scoped Search API Keys in Flutter App
Shane struggled with scoped search API keys in Typesense library for a Flutter app, which returned a 401 error. Jason identified that the error may be a result of an invalid filter within the key, and instructed to create separate keys for different permissions. On implementation, the error was resolved.
Resolving Issues with Scoped API Keys in Typesense with Golang
Suvarna had problems with generating and using scoped API keys in Typesense with Golang. Several bugs misleading the user were found and fixed by Kishore Nallan.
Issues with Generating Scope API Keys in Python
Danny had issues generating a valid scope API key in a Python GraphQL server. Jason suggested encoding changes and confirmed that the key length varies. Issue unresolved with Python, although JS library worked.
Correct API Key Generation and Usage on Cloud
Tom faced 401 errors while creating keys via the Cloud API. Kishore Nallan clarified the correct syntax and mechanics, and identified a header mislabeling on Tom's part that caused the issue. They also discussed using scoped API keys.