I have the client details that is get created on moodle. Also I did hit the https://localhost/mod/lti/token.php api and get the bearer token.
I wanted to get the user details but not able to figure out where I can find them. I'm confused if it has something to do with the scope as I didn't provide anything in the scope and send the request. I did commented the scope section in token.php file to get the output as I'm not sure what exactly I have to send in the scope.
This is the api I hit from the postman after creating the JWToken manually. token.php api
Also, what is the use of https://localhost/mod/lti/auth.php api. Please tell me about these things.
I would suggest reading the section of the IMS security framework that explains the OpenID Connect Launch flow. This will help you understand the purpose of the mod/lti/auth.php endpoint.
With regards to user details, you'd normally get these one of two main ways in LTI 1.3:
If you're making a service call to the NRPS service, you need to make sure you request a token with the relevant scope: 'https://purl.imsglobal.org/spec/lti-nrps/scope/contextmembership.readonly'. See the Scope and service security section of the specification.