6

Can someone please point me to the right direction with this; I have setup Azure Functions Authentications, it works fine when I deploy my function to Azure but locally the token is not validated hence the I can't retrieve the authenticated user. I am using Microsoft and Facebook authentications as well as a custom Authentication method, all working fine on Azure but locally none of them work!

I found this article which explains how it is done for Azure Mobile Apps however it seems that the method provided is not going to be possible for Functions.

user65248
  • 471
  • 1
  • 5
  • 17
  • check your login url and redirect url. probably it is a configuration issue – Derviş Kayımbaşıoğlu Dec 30 '18 at 22:22
  • Have checked those, all good. Sorry forgot to mention that I also have implemented a custom authentication method, that one also is working on Azure but not locally. – user65248 Dec 30 '18 at 22:50
  • check this post but not sure if it will help, do you really need to test it locally ? it will work properly from the portal anyway... are you checking specific claims ? https://stackoverflow.com/q/49390877/4167200 – Thomas Dec 31 '18 at 03:19
  • We need a bit more information, like some (relevant) code. Please try to provide a [mcve]. – rickvdbosch Dec 31 '18 at 07:11
  • 2
    Thanks, the issue has nothing to do with code, it's just a functionality that needs to be supported and enabled for Functions locally. I have now accepted the answer below. – user65248 Dec 31 '18 at 15:56

1 Answers1

4

Unfortunately, according to the How can we improve Microsoft Azure Functions? issue opened on Azure's feedback site, it seems that the functionality you require is currently not supported, but they are "looking into" it.

To work with the function locally, you'll probably need to mock the principal in some way.

Hope it helps!

Itay Podhajcer
  • 2,616
  • 2
  • 9
  • 14