Hi @GKaur
Of course, if the target user has joined your tenant as a guest, its authentication method is no different from that of a member user.
Since this involves user login, you need to use a delegated authentication flow to obtain an access token, such as the auth code flow.
First run the authorization URL in the browser and log in to the app using the guest user to get the authorization code.
https://login.microsoftonline.com/{tenant id}/oauth2/v2.0/authorize?
client_id={client id}
&response_type=code
&redirect_uri={redirect url}
&response_mode=query
&scope={scope}
&state=12345
Then use the authorization code to redeem the access token.
POST /{tenant}/oauth2/v2.0/token HTTP/1.1
Host: https://login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded
client_id={client id}
&scope={scope}
&code=OAAABAAAAiL9Kn2Z27UubvWFPbm0gLWQJVzCTE9UkP3pSx1aXxUjq3n8b2JRLk4OxVXr...
&redirect_uri={redirect url}
&grant_type=authorization_code
&client_secret={client secret}
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.