FQL v4 will be decommissioned on June 30, 2025. Ensure that you complete your migration from FQL v4 to FQL v10 by that date. For more details, review the migration guide. Contact support@fauna.com with any questions. |
Create a token
Solution
Use the Login
function:
{
ref: Ref(Tokens(), "309833836335727104"),
ts: 1631739422080000,
instance: Ref(Collection("characters"), "181388642114077184"),
secret: 'fnEETMA7ijACAARMwDsk0AYAu4E51VmH1w-Xm7qk8T6eJcbinkI'
}
{'ref': Ref(id=309834127742337536, collection=Ref(id=tokens)), 'ts': 1631739699980000, 'instance': Ref(id=181388642114077184, collection=Ref(id=characters, collection=Ref(id=collections))), 'secret': 'fnEETMB_Y2ACAARMwH7g0AYAw183rIQzi0_4AnRBYTUf15JxUg8'}
map[instance:{181388642114077184 0xc000109bc0 0xc000109bc0 <nil>} ref:{309834289381376512 0xc000109a10 0xc000109a10 <nil>} secret:fnEETMClBdACAARMwKQSgAIAKgw15g2WZCeCm3bkvhfEzvWDmpI ts:1631739854140000]
ObjectV(ref: RefV(id = "309834562535424512", collection = RefV(id = "tokens")),ts: LongV(1631740114630000),instance: RefV(id = "181388642114077184", collection = RefV(id = "characters", collection = RefV(id = "collections"))),secret: StringV(fnEETMDknxACAARMwOIEYAYAhr4xpyR13i1E4TokiFwAYsPz0LE))
{
ref: Ref(Tokens(), "309833029179671040"),
ts: 1631738652300000,
instance: Ref(Collection("characters"), "181388642114077184"),
secret: 'fnEETL9_m_ACAARMv36xQAYA0e8RzC8kR9TQDLEM5tEpq79-w_M'
}
You can also create one directly, if the identity document does not have
any credentials
defined:
{
ref: Ref(Tokens(), "309833836087214592"),
ts: 1631739421850000,
instance: Ref(Collection("characters"), "181388642114077184"),
secret: 'fnEETMA7e2ACAARMwDsk0AYATF1jLijRmK7HYAZDxe1snLrPWJs'
}
{'ref': Ref(id=309834127428813312, collection=Ref(id=tokens)), 'ts': 1631739699690000, 'instance': Ref(id=181388642114077184, collection=Ref(id=characters, collection=Ref(id=collections))), 'secret': 'fnEETMB_ULACAARMwH7g0AYASH2StILhxeWQQeZ709pMTxfYU-o'}
map[instance:{181388642114077184 0xc000180660 0xc000180660 <nil>} ref:{309834288701899264 0xc0001804b0 0xc0001804b0 <nil>} secret:fnEETMCk3VACAARMwKQSgAIAs-uMMiwCOxE2LCTVOI0ssKbxa5U ts:1631739853490000]
ObjectV(ref: RefV(id = "309834558324343296", collection = RefV(id = "tokens")),ts: LongV(1631740110630000),instance: RefV(id = "181388642114077184", collection = RefV(id = "characters", collection = RefV(id = "collections"))),secret: StringV(fnEETMDjpBACAARMwOIEYAYAO2NCSaJssZSdlcXUlgZmw70FnfE))
{
ref: Ref(Tokens(), "309833028300964352"),
ts: 1631738651480000,
instance: Ref(Collection("characters"), "181388642114077184"),
secret: 'fnEETL9_Z5ACAARMv36xQAYAsGq8dFWhaBsypurs5u8qAN6Zfm8'
}
The token’s secret is only ever shown once, in the response
from the Login function. If you lose the secret,
delete the token and create a new one.
|
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!