Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add firebase authentication in Mesop #510

Closed
10 of 11 tasks
harishmohanraj opened this issue Oct 30, 2024 · 0 comments · Fixed by #512
Closed
10 of 11 tasks

Add firebase authentication in Mesop #510

harishmohanraj opened this issue Oct 30, 2024 · 0 comments · Fixed by #512
Assignees

Comments

@harishmohanraj
Copy link
Contributor

harishmohanraj commented Oct 30, 2024

Client API:

# Client API
from fastagency.ui.mesop import MesopUI, 
from fastagency.ui.mesop.firebase_auth import FirebaseAuth, FirebaseConfig

# Create config
firebase_config = FirebaseConfig(
    api_key=os.getenv("FIREBASE_API_KEY"),
    auth_domain=os.getenv("FIREBASE_AUTH_DOMAIN"),
    project_id=os.getenv("FIREBASE_PROJECT_ID"),
    storage_bucket=os.getenv("FIREBASE_STORAGE_BUCKET"),
    messaging_sender_id=os.getenv("FIREBASE_MESSAGING_SENDER_ID"),
    app_id=os.getenv("FIREBASE_APP_ID")
)

# Initialize auth with Google sign-in
auth = FirebaseAuth(
    sign_in_methods={"google"},
    config=firebase_config
)

ui = MesopUI(auth=auth)
  • Figure-out client API
  • Implement the Auth class
    • Implement method to return the relaxed the security policy
    • Pass the firebase config to the web component
    • Read the service account JSON key file location form GOOGLE_APPLICATION_CREDENTIALS
    • Show chat page only when the signed email is in the AUTHORIZED_USER_EMAILS list
  • Integrate the Auth changes in MesopUI class
    • Add login and logout button
    • Show auth component only when the auth parameter is passed MesopUI(auth=auth)
  • Mesop tests
  • Documentation
@harishmohanraj harishmohanraj self-assigned this Oct 30, 2024
@harishmohanraj harishmohanraj changed the title Add firebase authentication to MesopUI class Add firebase authentication in Mesop Oct 30, 2024
@harishmohanraj harishmohanraj linked a pull request Oct 30, 2024 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants