I implemented OAuth2 authentication with Spring security legacy stack. After successful authentication I receive this payload:
{
"access_token": "ed090e76-444b-4dd2-8c2a-15d3e52be31d",
"token_type": "bearer",
"refresh_token": "4ad590f1-2139-47b8-89f1-29ed4b461b53",
"expires_in": 30,
"scope": "read"
}
I have a several types of roles into the application. Usually in server-side rendering web application I just will show UI components based on the user role and I will restrict the unauthorized content.
In Angular there is also a way to show data based on the user role. But the problem is how Angular can get the type of the user role from the BE Spring Server?
After successful authentication I need to get the user role from the BE. How this is usually implemented when there is a SPA FE?