pythonazureazure-functionsopenid-connecteasy-auth

EasyAuth on Azure Function App errors out custom oidc provider


We have a Python Linux azure function that is connected to a custom oidc provider and azure ad to provide authentication to the HTTP triggered functions using Microsofts easyauth.

After the initial setup, the azure function was working and has been working for the last few months.

In the last 2 days, our application suddenly started to error out on our custom provider, the azure ad authentication is still working, after checking the easyauth logs, we see the error

System.PlatformNotSupportedException: Windows Cryptography Next Generation (CNG) is not supported on this platform.

No changes were made on either the custom oidc provider or the azure function in the last 2 days. We suspect that maybe the base easyauth docker image (mcr.microsoft.com/appsvc/middleware:stage2) got updated and that broke the authentication.

Any ideas or suggestions on possible fixes or even related problems?


Solution

  • Could it be due to this: https://github.com/Azure/app-service-announcements/issues/404

    Use RSACNG when validating tokens to add PS256 support

    EDIT: Also experiencing this issue as of this morning. I'm currently trying to manually downgrade the version using this command az webapp auth update --name xxx --resource-group xxx --runtime-version "1.5.1" but my Azure credentials don't have enough power to run that so I can't validate if it works or not.

    EDIT2: Doesn't work if you are using auth v2.

    EDIT3: It actually does work if you are using auth v2. You just have to check the help options of the command to realize that for auth v2 you have to install a CLI extension with command az extension add --name authV2. After that you can run the commands. I downgraded the version to 1.5.1 but nothing changed. I'm not sure if it has something to do with the fact that we are deploying to a slot first which probably had the new version still. I have also created an Azure support ticket about this.

    EDIT4: Got in to a support call with Azure yesterday. They fixed the issue during the night. A restart of the application is required. I'm still baffled by the fact that the documentation shows that you can pinpoint the version of Easy Auth / Authentication/Authorization middleware but when I go to troubleshoot my AppService and select Easy Auth it actually shows that the pinpointed version is 1.5.1 and the running version is 1.6.2. So it just totally ignores the whole configuration. Fun, right?