arlac77 / svelte-session-manager

Session store for svelte (currently only for JWT)
BSD 2-Clause "Simplified" License
106 stars 7 forks source link

[Suggestion] Getting entitlements from MS Identity #480

Open moalamri opened 3 years ago

moalamri commented 3 years ago

Hi, I'm using this package along with Asp.NET Core WebApi using Microsoft Authentication Library (MSAL). Everything works great and I've made changes to the server-side payload so they match the package key names.

The package uses Entitlements, While (if I correctly understand it) MS uses what so called Claims I have made a small library that parse those claims from the JWT stored in the package and used it in my project. Do you plan to have this implementation to this package? If so then I could make a PR, but first I would like to discuss the best practice for this as so it will have different parsing methods therefore there could be an initialization option to tell the package what type of parsers methods to use according to the payload authentication type.

Thank you :)

arlac77 commented 3 years ago

We probably need to start thinking about some kind of (lightweight) plugin system to adopt to the different needs. Is there a free service in the microsoft cloud to play around with MSAL?

moalamri commented 3 years ago

Hi, that would be a huge forward step for this package. I'm using MSAL on my computer, no need to a cloud account. You can just create new WebApi Reactjs project on Visual Studio and enable identity option during the creation. It will come with the basic MSAL. Later if you want you can add extra Claims to the payload (eg roles and policies) and use claims key