@Mellin, Jonas Please navigate to your project setting and under polices please make sure that the Third-party application access via OAuth
is enabled. As this could be the other reason you will get the 401 error if the user has the right permission, and your organization doesn't restrict it.