I currently have 2 web apps(app services) setup on azure. The first one is an angular 4 website the second one is a .net core 2.0 restful api. I have CORs setup for the ui to talk to the api perfectly. The only issue is there isn't any security around this API.
I am attempting to utilize the azure AD JWT token to be part of an authorize attribute within the API but the problem is the API can't validate the token since I don't have the secret key that azure is using to create the JWT token to begin with. Also I am getting the token from /.auth/me. Does anyone have any advice on how best to solve this problem?
Is there an api endpoint on azure that I can hit to get a valid JWT token for the current logged in user? I noticed the /.auth/me one expires after an hour and the user is forced to visit /.auth/login/aad/callback in order to refresh the tokens.
I would love to know the best strategy to solve this, if it includes adal, msal, etc. Also links to code would be very much appreciated.