We're using the JWT flow to retrieve session IDs for the current user in a Lightning Community, for use in code running outside of Salesforce. In particular, we use that session ID to run SOSL queries on behalf of the current user.
It works very well when a user is logged in, but when accessing the community in Guest mode Salesforce seems to use some kind of "virtual" user that is a member of a particular profile. For this user the JWT flow doesn't work, even though we "pre-approved" the Connected App for this profile, as we did for the others.
Another option for us is to provide explicit configuration options to designate a real user that will be used for "guest" users, but this makes the setup steps more complex...
Does anybody knows of a way to use that flow to get a Session ID that would provide the same access as the "guest" user?