As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
want to provide login credentials when someone wants to access some documents
Create the user and add the user to respective site with consumer permissions then they can access the documents in read only mode.
or
If they access the documents for read-only mode then its better to share link to user where user no need to login.
Go through below links related to permissions/roles:
User roles and permissions | Alfresco Documentation
Permissions / Roles | Alfresco Documentation
thank you kkumar