I am making a Java Spring Boot application where the users are authenticated with JWT. I want to have a user role that can authenticate by only a generated code sent by the admin (so the user neither has to register because it is added to the database by the admin nor has to add a username to log in, only this generated code). My idea is similar to when you order something online and you get a code to follow your order status at the shipper's site.
Is there a specific authentication type to implement this thing, and how should these generated codes be stored in the database?