Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Antiforgery token validation failed. The required antiforgery cookie is not present. iOS Auth. iPad. #14165

Closed
RA-Work-A opened this issue Sep 19, 2019 · 8 comments
Assignees
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates External This is an issue in a component not contained in this repository. It is open for tracking purposes.
Milestone

Comments

@RA-Work-A
Copy link

Describe the bug

A clear and concise description of what the bug is.
0. Default web app is unable to be signed in / registered from iPad.
Error logs show the following:

2019-09-19 12:12:15.0486|1|INFO|Microsoft.AspNetCore.Hosting.Internal.WebHost|Request starting HTTP/1.1 POST http://localhost_on_IIS:5015/Identity/Account/Login application/x-www-form-urlencoded 270
2019-09-19 12:12:15.0486|1|INFO|Microsoft.AspNetCore.Mvc.RazorPages.Internal.PageActionInvoker|Route matched with {page = "/Account/Login", area = "Identity", action = "", controller = ""}. Executing action /Account/Login
2019-09-19 12:12:15.0486|1|INFO|Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.AutoValidateAntiforgeryTokenAuthorizationFilter|Antiforgery token validation failed. The required antiforgery cookie ".AspNetCore.Antiforgery.pwALLqxivEg" is not present. Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The required antiforgery cookie ".AspNetCore.Antiforgery.pwALLqxivEg" is not present.
at Microsoft.AspNetCore.Antiforgery.Internal.DefaultAntiforgery.ValidateRequestAsync(HttpContext httpContext)
at Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ValidateAntiforgeryTokenAuthorizationFilter.OnAuthorizationAsync(AuthorizationFilterContext context)
2019-09-19 12:12:15.0486|3|INFO|Microsoft.AspNetCore.Mvc.RazorPages.Internal.PageActionInvoker|Authorization failed for the request at filter 'Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.AutoValidateAntiforgeryTokenAuthorizationFilter'.
2019-09-19 12:12:15.0486|1|INFO|Microsoft.AspNetCore.Mvc.StatusCodeResult|Executing HttpStatusCodeResult, setting HTTP status code 400
2019-09-19 12:12:15.0486|2|INFO|Microsoft.AspNetCore.Mvc.RazorPages.Internal.PageActionInvoker|Executed action /Account/Login in 1.7633ms
2019-09-19 12:12:15.0518|2|INFO|Microsoft.AspNetCore.Hosting.Internal.WebHost|Request finished in 3.3011ms 400

To Reproduce

Steps to reproduce the behavior:

  1. Create default site
  2. scaffold identity framework
  3. spin up either local db or connect to db
  4. register on pc to make sure works
  5. attempt to register on ipad
  6. error is thrown in logs.
  7. ipad screen shows no error. just a white screen.

Expected behavior

A clear and concise description of what you expected to happen.

I expect to be able to login/register via an ipad.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.
Include the output of dotnet --info
Host (useful for support):
Version: 2.1.12
Commit: ccea2e606d

.NET Core SDKs installed:
1.1.11 [C:\Program Files\dotnet\sdk]
2.1.500 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

iPad 12.4.1
tried site in safari and chrome (on iPad)

keys are persisted on disk drive.

repo can be found here --> https://github.com/RA-Work-A/AntiForgeryToken

@RA-Work-A RA-Work-A changed the title ntiforgery token validation failed. The required antiforgery cookie ".AspNetCore.Antiforgery.pwALLqxivEg" is not present. Antiforgery token validation failed. The required antiforgery cookie is not present. iOS Auth. iPad. Sep 19, 2019
@pranavkm pranavkm added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Sep 19, 2019
@blowdart
Copy link
Contributor

This is a known bug in Safari right now. Have you tried updating to iOS13?

@RA-Work-A
Copy link
Author

@blowdart I haven't tried that. Is there a work-around? Our QA team is unable to test since all (sans older iPads) are unable to login?

@blowdart
Copy link
Contributor

Try #4647

Note that when Chrome changes how it works in January and we update our code to match them Safari will be broken again, but we will have more advice in place before then.

@blowdart
Copy link
Contributor

Yea I know, it's confusing. Google unilaterally changed how they implement same site in a way that will cause Safari to treat "None" as, in fact, strict. We'll have code samples in a month or so and updates.

@javiercn
Copy link
Member

@blowdart Can you take care of updating this issue when the samples are available?

@blowdart blowdart self-assigned this Sep 20, 2019
@mkArtakMSFT mkArtakMSFT added this to the Discussions milestone Sep 23, 2019
@mkArtakMSFT mkArtakMSFT added the External This is an issue in a component not contained in this repository. It is open for tracking purposes. label Sep 23, 2019
@CribAd
Copy link

CribAd commented Oct 25, 2019

Is there any update on this?

@RA-Work-A
Copy link
Author

RA-Work-A commented Oct 25, 2019

@CribAd , my team and I ended up just upgrading our iOS devices to 13.x.x. This "resolved" our issue for our newer devices. Any device that is unable to update to this version still has this issue. Eg, we have an iPad (4th gen), that we cannot update. This device still exhibits the issue.

@ghost
Copy link

ghost commented Nov 12, 2020

Thank you for contacting us. Due to a lack of activity on this discussion issue we're closing it in an effort to keep our backlog clean. If you believe there is a concern related to the ASP.NET Core framework, which hasn't been addressed yet, please file a new issue.

This issue will be locked after 30 more days of inactivity. If you still wish to discuss this subject after then, please create a new issue!

@ghost ghost closed this as completed Nov 12, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 12, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates External This is an issue in a component not contained in this repository. It is open for tracking purposes.
Projects
None yet
Development

No branches or pull requests

6 participants