We have been tasked with implementing a dashboard containing multiple widgets. The dashboard itself and all widgets need to access various secured APIs. Our authorisation protocol is OpenID.
Currently, the dashboard requests an access_token with all scopes required by all widgets. Widgets use this shared access_token to make requests to secure APIs.
The problem is, because this shared access_token has so many scopes, it is too "powerful". We are concerned that by using this shared token, widgets and APIs may have more rights than they are entitled to. Ideally we'd like that every widget has a separate access_token with its own scope.
I'm not sure how to achieve this. If every widget requests its own access_token, then the user will be redirected to authorisation endpoint multiple times. This is unacceptable for UX reasons.
We have considered wrapping widgets in iframes. So each widget can redirect inside of its own frame without affecting the dashboard. However, because they all run on the same domain, they can always access access_tokens of other widgets (because they are stored in LocalStorage), so I'm not sure this is better from a security perspective.
How can we architecture the authorisation system in a dashboard so that all widgets have their own access_tokens?
access_tokenrepresents authentication OK, but is too opaque to be used for authorization purposes. JWT (theid_token) can include the roles or any application specific values which can be further used by each widget. I agree, multiple authentications are less than ideal, but can be handled without user interaction. That's similar to how Atlassian JIRA's dashboard works. Unless you have full PKI that requires you to enter a pin, it's invisible to the user.access_tokenmeans authorization, not authentication due to OAuth2 being an authorization framework. What do you mean by "can be handled without user interaction"? I'm under impression that users need to give their consent explicitly.