0

I want to create a short dynamic link with firebase, which will able auto login for users on mobile, without inserting credentials manually. I also want to get analytics for each user (if he clicked the link, which link, success/fail etc.).

So far, I succeeded to integrate with firebase REST api and generate a unique dynamic link for each api call.

{
  "dynamicLinkInfo": {
        "dynamicLinkDomain": "example.app.goo.gl",
    "link": "https://www.example.com",
    "androidInfo": {
      "androidPackageName": "com.example.mobile.android"
    },
    "iosInfo": {
      "iosBundleId": "com.example.app.ios"
    }
  }
}

However, I also want to add user id & jwt token for each user.

My question(s):

1) Should I add the user id as a param when I creating the short link with firebase api? or as query string?

2) Which params or custom params should I use?

3) Is it a good practice to send jwt token as query string in the dynamic link?

wizard
  • 583
  • 2
  • 9
  • 26
  • Its hard to answer the "is it a good practice" without knowing what security properties you're trying to ensure. In general, logging in via a link isn't great unless that link is expired after each usage (in which case you may want to look at a custom token generator and using Firebase custom auth) – Ian Barber Jan 30 '18 at 00:18

1 Answers1

3

You can add user id and any other info to deep link. So instead of https://www.example.com you will have https://www.example.com?user_id=123

Deep link is your own thing, you can have whatever you want/need in deep link.

Oleksiy Ivanov
  • 2,454
  • 15
  • 21