Reputation: 263
We want to authorize User against Azure AD group in SPA (React JS); i.e. User allows to access API from SPA if he/she belongs to a Particular group (e.g. testgroup). Found sample code in Msal.JS.
I'm following
Call MS Graph to retrieve all AD Groups where User belong to
Url to get AD Groups - https://graph.microsoft.com/v1.0/me/memberOf
Please suggest me whether I am going in Right direction or any other options are available.
Thanks for your suggestion.
Regards,
Deb
Upvotes: 1
Views: 1753
Reputation: 141
Rather than using msal.js, I used react-aad-msal. It is msal wrapper library and it went much smoother.
I would try this
https://ahsanshares.wordpress.com/2019/10/19/react-app-consuming-microsoft-graph/
Upvotes: 1