"Cannot read property 'startsWith' of undefined" when using OAuth refresh token

eric_paulsen
edited November 2022 in

This item has been identified as an outstanding known issue.  A workaround is provided until the issue is officially fixed.

Issue

When using OAuth, the error "Cannot read property 'startsWith' of undefined" is received when attempting to use a refresh token to receive another access token.

This error most commonly appears when using a Device grant with a non-rotatable token. When following the authorization flow, if you confirm the device code in a browser session where there is also an active Anaplan session, you will not be prompted to login to Anaplan but will receive a success message. The authorization grant can be used to successfully receive an access token, but any attempt to refresh with the refresh token will fail with the above error.

Workaround

Open the device code verification link in another browser session (new browser, incognito window, etc.) where you are not currently logged into Anaplan. When you open the code verification link and confirm the code, you should next be prompted to log into Anaplan, then receive a success message. Your refresh token should now work until the configured expiration time.

If this workaround is not suitable in your use case, please contact Support at support@anaplan.com.

---

Internal Reference: AUTHN-2007