Firebase自定义身份验证如何创建电子邮件,而不仅仅是uid

时间:2016-09-14 16:00:56

标签: php firebase firebase-authentication

我在firebase中使用cusotm auth,我生成了这样的JWT令牌:

$userId = '1234';
$email = 'sample@email.com';
$key = 'giant_key_goes_here';

$payload = [
    'iss' => $email,
    'sub' => $email,
    'aud' => 'https://identitytoolkit.googleapis.com/google.identity.identitytoolkit.v1.IdentityToolkit',
    'iat' => time(),
    'exp' => time() + 60 * 60,
    'uid' => $userId,
    'claims' => [
        'uid' => $userId,
    ],
];

$token = JWT::encode($payload, $key, 'RS256');

当我稍后在ios设备中使用该令牌登录firebase时,将创建新用户。

但是,是否可以同时创建用户电子邮件,而不仅仅是uid?

0 个答案:

没有答案