Admin panel: 401 error on custom permissions with httponly cookie

It appears you are trying to link two very different auth methods. Users-Permissions doesn’t related to the Strapi admin at all and vice versa.

The guide you linked is referencing the users-permissions thus what we call “end user” routes. The admin itself uses passport.js. Each of these will need it’s own implementation of the httpcookie method.

Users-Permissions “end users” and Strapi Admins are two different types of users from two different plugins, one cannot auth with the other (yet).