Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Aaron Powell 1708 posts 3043 karma points c-trib
    Sep 23, 2015 @ 06:42
    Aaron Powell
    0

    Back office API controller failing with 417

    Umbraco version: 7.2.4

    I'm seeing a bunch of errors in our back office on all environments (from localhost to production) where the /umbraco/backoffice/UmbracoApi/Authentication/GetRemainingTimeoutSeconds route is returning a 417 Invalid Token response.

    Doing some digging into the core I found the problem is coming from the AngularAntiForgeryHelper and the ValidateTokens method must be returning false.

    This tends to happen when the back office is logged in for a "reasonable" period of time and not interacted with, it seems navigating around delays the error cropping up.

    Thoughts on what could be causing an invalid token to appear?

  • Jeroen Breuer 4859 posts 12120 karma points MVP 3x admin c-trib
    Sep 23, 2015 @ 07:11
  • Aaron Powell 1708 posts 3043 karma points c-trib
    Sep 23, 2015 @ 07:23
    Aaron Powell
    0

    Thanks internet search engines for not finding that one :P

    Did you ever solve it yourself? I'll try not having two tabs opened.

  • Shannon Deminick 1476 posts 4950 karma points hq
    Sep 23, 2015 @ 20:01
    Shannon Deminick
    0

    Two tabs open works, I do this all of the time. If you have steps to replicate let us know.

  • Aaron Powell 1708 posts 3043 karma points c-trib
    Sep 23, 2015 @ 23:28
    Aaron Powell
    0

    I'm have a crack at debugging it (there's a try/catch where the exception is swallowed!) but of course when I run with a debugger attached the problem doesn't exist :(.

    I can repo it really easily in our instance but the git repository isn't sharable for that :P

  • Aaron Powell 1708 posts 3043 karma points c-trib
    Sep 28, 2015 @ 00:14
    Aaron Powell
    0

    It seems related to our AngularJS front-end and the use of the antiforgery token there too. If i have two tabs open (one the front end and the other Umbraco) I get the errror, if I only have the backoffice open (and the front end in a private mode tab or another browser) it doesn't happen.

    Chalking it up to "our implementation" as the root cause.

  • Shannon Deminick 1476 posts 4950 karma points hq
    Sep 28, 2015 @ 08:28
    Shannon Deminick
    0

    I guess yeah, if you are using an implementation like that on your front-end too, it might cause issues... but if you are using different cookie/token names than the back office it should still 'just work'

  • Aaron Powell 1708 posts 3043 karma points c-trib
    Sep 28, 2015 @ 10:46
    Aaron Powell
    0

    You're making an assumption that someone considered that :P

  • Anton 28 posts 116 karma points
    Oct 01, 2015 @ 07:49
    Anton
    1

    Just in case - in my usecase issue with '417 Invalid token' was in the fact that our code was adding a cookie with spaces in name. Actually, though it is violating cookie names, it was working everywhere, except Umbraco backoffice, which, after receiving cookie with spaces in name - begin generating 417 errors

  • Mohsin Bhatti 14 posts 92 karma points
    Jun 08, 2017 @ 12:20
    Mohsin Bhatti
    0

    Hello All,

    we have facing the same issue with Umbraco version 7.1.4 assembly: 1.0.5261.28127

    when we login to umbraco; get blank frames from left side. Left menu is completely empty because of error that show in console(please see the image).

    If we reload(press F5) the page it works fine.It is consistent every time; log in, nothing works, F5, everything works.

    we also try to clear cookies and caches of browser. But still issue remain same.

    Is this something Umbraco have done or something that had been caused by a change?

    we get the following errors in the backoffice.

    Failed to load resource: the server responded with a status of 417

    /umbraco/backoffice/UmbracoApi/UpdateCheck/GetCheck Failed to load resource: the server responded with a status of 417 (Missing token)

    /umbraco/backoffice/UmbracoApi/Section/GetSections Failed to load resource: the server responded with a status of 417 (Missing token)

    /umbraco/backoffice/UmbracoApi/Dashboard/GetDashboard?section=content Failed to load resource: the server responded with a status of 417 (Missing token)

    /umbraco/backoffice/UmbracoApi/Authentication/GetRemainingTimeoutSeconds Failed to load resource: the server responded with a status of 417 (Missing token)

    angular.min.js:106 POST http://www.boyerplanning.co.uk/umbraco/backoffice/UmbracoApi/Authentication/PostLogout 417 (Missing token)

    Anyone has an solution to this problem?enter image description here

Please Sign in or register to post replies

Write your reply to:

Draft