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

Application user permissions not working

Scheduled Pinned Locked Moved
Q&A
0
6
666
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.
  • C
    chris.smith
    last edited by 8 Jan 2021, 17:00

    I'm just starting out with FusionAuth. I'm following the '5-Minute Setup Guide' and am using the fusionauth-node-example on GitHub.

    At the point where I create the test user I thought I'd try logging in to the application, to verify that the login is rejected without the application registration. To my surprise I find that the test application accepts the user login without requiring a registration. What have I done wrong?

    1 Reply Last reply Reply Quote 0
    • D
      dan
      last edited by 8 Jan 2021, 17:56

      Hi Chris,

      The sample application only shows authentication (does FusionAuth recognize the user?) not authorization. I should probably update the docs to make that more clear. Sorry about the confusion.

      Here's docs on what your application needs to do (by looking in the JWT) to see if a user is authorized: https://fusionauth.io/docs/v1/tech/core-concepts/authentication-authorization/

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

      1 Reply Last reply Reply Quote 0
      • D
        dan
        last edited by 8 Jan 2021, 18:46

        I added an authorization check to the node code: https://github.com/FusionAuth/fusionauth-example-node/commit/5d551501e292df88c89e7352112b4b990ca65f0b

        And submitted a PR to update the docs to make it clearer: https://github.com/FusionAuth/fusionauth-site/pull/367

        Cheers!

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

        C 1 Reply Last reply 11 Jan 2021, 10:37 Reply Quote 0
        • C
          chris.smith @dan
          last edited by 11 Jan 2021, 10:37

          @dan Thank you, but the example app now no longer works for me. Clicking the 'login' link on the example page now gives the following error on the Node.js console:

          in error
          {}
          

          This appears to have been triggered by line 34 of routes/index.js.

          The breakage seems to have been introduced by commit 5d55150 -- my only changes are to the clientId, clientSecret and the auth URLs (I'm not running on localhost:9011) and the example was working fine for me immediately prior to this commit.

          1 Reply Last reply Reply Quote 0
          • C
            chris.smith
            last edited by 11 Jan 2021, 11:13

            @dan Ok, it would seem that the 'response.response.user' object does not contain a 'registrations' entry if the user doesn't have any registrations at all.

            I've forked, fixed and created a PR.

            1 Reply Last reply Reply Quote 0
            • D
              dan
              last edited by 11 Jan 2021, 14:19

              Thank you. Merged the PR. That was a boneheaded mistake on my part, sorry about that!

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

              1 Reply Last reply Reply Quote 0
              6 out of 6
              • First post
                6/6
                Last post