@kautuk_sahni - here you go with the details.
For establishing authentication on Publish end where we will expose data to the systems, when the systems hit the GraphQL end point. Below mentioned are the steps involved, sequentially as-is, for CUG Implementation.
1. Create a custom folder under "/content/dam", and can create any sample content fragments under that folder.
2. Create a custom user group local to AEM instance, push it through repo-init config, on Author and Publish. We have only Author repo-init configuration in the beginning. So, for this need, we added a repo-init config for Publish as well.
Example code for both Author and Publish:
create group <custom_group> with path /home/groups/xyz/
3. Apply permissions to this custom group only on Publish side, so it has access to custom folder that holds the CF data for that respective need. Example code:
set ACL for <custom_group>
remove * on /content/dam/<custom_folder>
##Permissions for <custom_group> group
allow jcr:all on /content/dam/<custom_folder>
allow jcr:all on /conf/<cf_model_config_folder>
allow jcr:all on /content/cq:graphql/<endpoint>
end4. Remove read permissions from everyone group, for that respective custom folder so it doesn’t expose that data to “everyone” through GraphQL. Example:
set ACL for everyone
remove * on /content/dam/<custom_folder>
##Deny Rules of everyone
deny jcr:all on /content/dam/<custom_folder>
end5. Add the above sample code from Step 2-4 in repoinit config on Publish side, where all the restriction is needed.
6. Create a technical service user account from AdminConsole for the respective environment.
7. This will now show up in AEM Author Users console. Add the custom group that was created through repo-init to the user and Publish the User.
8. Now generate an Access Token or JWT-Token for hitting the GraphQL endpoint to validate the authentication.
9. User the generated Access Token in the above step to establish authentication via Postman of type “Bearer token” and we should see a response.