FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login
    1. Home
    2. charlotteharrison0913
    C
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    charlotteharrison0913

    @charlotteharrison0913

    0
    Reputation
    1
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    charlotteharrison0913 Unfollow Follow

    Latest posts made by charlotteharrison0913

    • RE: React SDK example - nothing in the userInfo but tid and sub

      @jw-0 said in React SDK example - nothing in the userInfo but tid and sub:

      I'm sure I'm doing something stupid here but I can't work out what I haven't done.

      I am using the changebank React SDK example as my test harness, using the community version of FusionAuth for now, hosted under docker
      I've created a new tenant, a new app and then a new user.
      I can login using this new user into the app but the userInfo structure has nothing in it other the the use sub and the tid.

      Config is below

      const config: FusionAuthProviderConfig = {
      clientId: "31067471-23fc-4634-afa9-c049ff4f0a86",
      redirectUri: "http://localhost:5173", slope run

      serverUrl: "http://localhost:9011/",
      shouldAutoFetchUserInfo: true,
      shouldAutoRefresh: true,
      onRedirect: (state?: string) => {
      console.log(Redirect happened with state value: ${state}"});
      }
      };

      Example code is:
      In main.tsx
      const { isLoggedIn, isFetchingUserInfo, userInfo } = useFusionAuth();

      In the AccountPage.tsx I have:

          <p>tid {userInfo?.tid}</p>
          <p>sub {userInfo?.sub}</p>
          <p>roles {userInfo?.roles}</p>
          <p>email {userInfo?.email}</p>
      

      The roles and email fields are always null

      Any ideas?

      In FusionAuth, ensure that the user claims are set up correctly. Go to the tenant settings and check the "User Claims" section to confirm that the necessary claims (like email, name, etc.) are included. Make sure that your application is requesting the correct scopes during the authentication process. Common scopes include openid, profile, and email. Verify that these scopes are included in your authentication request. Review the ChangeBank React SDK example to ensure it correctly handles the userInfo endpoint. There may be specific configurations or API calls that need to be made to retrieve additional user data.

      posted in General Discussion
      C
      charlotteharrison0913
    • RE: React SDK example - nothing in the userInfo but tid and sub

      After logging in, inspect the JWT token returned by FusionAuth. You can decode it using a tool like jwt.io to see what claims are included. This can help you understand what data is being returned. Review the implementation of the ChangeBank React SDK example to ensure that it correctly handles the userInfo endpoint. There may be specific configurations or calls that need to be made to retrieve additional user data https://fusionauth.io/community/forum/topic/2754 slope run

      posted in General Discussion
      C
      charlotteharrison0913