Security icon indicating copy to clipboard operation
Security copied to clipboard

Azure AD - AADSTS90014: The required field 'nonce' is missing.

Open tstojecki opened this issue 11 years ago • 3 comments

Hi, We're running web api backend with a spa client. Web api has been configured with OpenId Connect middleware

app.UseOpenIdConnectAuthentication(
                new OpenIdConnectAuthenticationOptions
                {
                    ClientId = "xxx",
                    Authority = "https://login.windows.net/xxx/"
                });

This results in a challenge request being issued

this.Request.GetOwinContext().Authentication.Challenge(this.LoginProvider);

that eventually ends up redirecting to Azure login page

After a successful login fiddler shows the following response being sent back

AADSTS90014: The required field 'nonce' is missing.

Any idea what we're missing here?

Thanks!

tstojecki avatar Sep 23 '15 15:09 tstojecki

The OWIN components are maintained here: http://katanaproject.codeplex.com/.

You should use Fiddler or Netmon to get details about what's happening.

OIDC is a poor fit for WebApi as it requires user interaction and cookie flowing. Bearer may be more appropriate.

The most common nonce issue is http://katanaproject.codeplex.com/wikipage?title=System.Web%20response%20cookie%20integration%20issues&referringTitle=Documentation

Tratcher avatar Sep 23 '15 19:09 Tratcher

Hi @Tratcher, I did use fiddler,which is where I got AADSTS90014: The required field 'nonce' is missing.

Any pointers on where we would be able to control how the nonce is set before the request goes out to AAD?

tstojecki avatar Sep 24 '15 10:09 tstojecki

See http://katanaproject.codeplex.com/wikipage?title=System.Web%20response%20cookie%20integration%20issues&referringTitle=Documentation

Tratcher avatar Sep 24 '15 15:09 Tratcher