简体   繁体   English

我的 firebase_admin 配置可以很好地验证用户吗?

[英]My configuration of firebase_admin is good to authenticate users?

I want to verify the token id my code its working, but why is working?我想验证我的代码的令牌 id 是否有效,但为什么有效? i setup good?我设置好了吗?

i have that doubt because auth variable does not know the credentials to verify the token, the variable who know the credentials is firebase_app , how auth variable is verifying the token?我有这个疑问,因为 auth 变量不知道验证令牌的凭据,知道凭据的变量是firebase_app ,auth 变量如何验证令牌?

from firebase_admin import auth
from django.conf import settings

firebase_creds = credentials.Certificate(FIREBASE_CONFIG_credentials)
firebase_app = firebase_admin.initialize_app(firebase_creds)


def login(request):
    token = 'eyJhbGciO...'
    try:
        decoded_token = auth.verify_id_token(token)

Auth comes from firebase_admin:身份验证来自 firebase_admin:

from firebase_admin import auth

When you initialize firebase_admin:初始化 firebase_admin 时:

firebase_app = firebase_admin.initialize_app(firebase_creds)

you are also initializing all of its components.你也在初始化它的所有组件。

If your calls are not returning any errors, then everything is OK.如果您的调用没有返回任何错误,那么一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 python 上调试 firebase_admin - How to debug firebase_admin on python Python Firebase 问题没有名为 firebase_admin 的模块 - Python Firebase issue No module named firebase_admin Firestore AttributeError:模块“firebase_admin”没有属性“firestore” - Firestore AttributeError: module 'firebase_admin' has no attribute 'firestore' 在 firebase_admin 上使用“where”查询时无法过滤数据 - cannot filter data when using `where` query on firebase_admin firebase_admin auth.verify_id_token 很慢 - firebase_admin auth.verify_id_token is very slow 为什么 firebase_admin 在运行多进程时无法解析 - Why firebase_admin doesn't resolve when running multiprocesses 如何使用 firebase_admin 从 python 中的 firebase 存储中下载文件 - How to download file from firebase storage in python using firebase_admin 如何在同一项目中为 firebase_admin 应用程序的每个实例使用模拟器 - How to use an emulator for each instance of firebase_admin app, in the same project 如何使用带有 get() 的 firebase_admin 查询 firestore 文档 - How do I query a firestore document using firebase_admin with get() 尝试在 firebase 中使用 google 对用户进行身份验证时出错 - Error when trying to authenticate users with google in firebase
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM