Hi,
bit of a background. we have a SPA (single page application) at frontend, and backend is running on NodeJS. When user opens the application, the app will authenticate the user based on the route to a relevant portal. E.g. if he opens the route that is listing the AGOL related content, the application will prompt OAuth2.0 sign in for that portal (unless he is already signed in). So there are multiple portals and application is conveniently switching between the different portal accounts for the user using the application, and the application has all the tokens generated by the OAuth process available.
We also have a back-end, which can be harvesting some data at the background from different portals using mainly the admin accounts, or accounts that are usually of the top-privileged roles, and this all works well.
However, I'd like to add a authenticating middle-ware on our nodejs api, that would take the user's token (SPA will provide this token) and possibly a username, and I'd like to be able to verify this token/username with the ArcGIS Portal. Is there a way to do it?
Ideally I'd like to have a endpoint in portal, to which I can provide the token coming from the user, and the portal would tell me it's this user and the token is valid. I can then gather what I need about the user and either allow the code to execute further or raise 401.
Any ideas ?
Thank you!