• Home
  • Categories
  • Recent
  • Popular
  • Pricing
  • Contact us
  • Docs
  • Login
FusionAuth
  • Home
  • Categories
  • Recent
  • Popular
  • Pricing
  • Contact us
  • Docs
  • Login

JWT claims and Identity Provider

Scheduled Pinned Locked Moved Solved
Q&A
2
3
2.5k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q
    quent
    last edited by 25 Apr 2022, 08:24

    Hi,

    I configured Fusionauth for the authentication on my API, so far working fine.

    I linked some external accounts (other Identity Provider) to some Fusionauth users, the authentication works fine as well.

    Now i wonder if I can retrieve in a claim of the JWT from which identity provider the user account is linked to ? The authentication is managed by Fusionauth, but is there a way to know if that user has a linked account, just reading the claims of the JWT ? I would like to differentiate FA's user without linked from users with linked account

    Thank you

    D 1 Reply Last reply 30 Apr 2022, 14:12 Reply Quote 0
    • D
      dan @quent
      last edited by 30 Apr 2022, 14:12

      @quent

      You could do this in a couple of different ways.

      You should be able to examine the authenticationType claim, as documented here: https://fusionauth.io/docs/v1/tech/oauth/tokens#access-token

      You could create a custom reconcile lambda for the Identity Provider and set a custom claim, as documented here: https://fusionauth.io/docs/v1/tech/lambdas/google-reconcile (for google, there are analogous lambdas for every Identity Provider).

      Note that a user could be linked to more than one Identity Provider, so you should plan to handle that edge case.

      Hope that helps.

      --
      FusionAuth - Auth for devs, built by devs.
      https://fusionauth.io

      Q 1 Reply Last reply 10 May 2022, 20:40 Reply Quote 0
      • Q
        quent @dan
        last edited by 10 May 2022, 20:40

        @dan Thank you, yes I can use lamba, i did give it a try and it works fine 🙂
        The authentication type does works too, but maybe more in a "workaround way".

        Thanks

        1 Reply Last reply Reply Quote 1
        • Q quent has marked this topic as solved on 11 May 2022, 07:11
        • First post
          Last post