Note that: If you are making use of Client credential flow and granting application permissions to the Microsoft Entra ID application, it is mandatory and by default you must grant permissions in the Add-in to allow Full Access to the application.
If you want to avoid registering app in the Add-In and giving full access, then you can grant delegated API permissions and make use of delegated flow as a workaround:
Grant delegated API permission to the Microsoft Entra ID application:

Use the below endpoint to authorize users:
https://login.microsoftonline.com/TenantID/oauth2/v2.0/authorize?
&client_id=ClientID
&response_type=code
&redirect_uri=https://jwt.ms
&response_mode=query
&scope=https://Domain.sharepoint.com/.default
&state=12345

Generate access token by using below parameters:
https://login.microsoftonline.com/TenantID/oauth2/v2.0/token
grant_type:authorization_code
client_id:ClientID
client_secret:ClientSecret
scope:https://Domain.sharepoint.com/.default
code:code
redirect_uri:https://jwt.ms

By using the above access token, you can call the SharePoint Rest API:
https://domain.sharepoint.com/_api/Web/RoleAssignments
