My managed package needs to access data from multiple Orgs. For example, say a user has 2 accounts: 1 in Org A, and 1 in Org B. When the user is logged in to Org A, they need to see data from both Org A and Org B. I experimented with obtaining an access token for Org B while the user was logged in to Org A. I created a web service that handled this process by using the Web Server OAuth flow. However, the problem I ran into was that at the point of making the initial request to get the authorization code, https://login.salesforces.com/services/oauth2/authorize, that is in the context of the current logged in user. So it never asks the user to log in to Org B since the user has already has approved access to our connected app in Org A. I thought that the OAuth connected app approval process might be independent of the context of the current logged in user, but that is not the case. Is there a way to get around that? Is there another OAuth flow that would work better? or is there another way of achieving this?
EDIT: Additional requirement: For each user that issues a cross-org query for data, the query needs to respect their security settings.