When im in incognito mode in browser(any browser) or when 3rd party cookies are blocked, getAccessTokenSilently, throws error ‘login required’, even though i logged in using login form, auth0 cookies are not set. I have custom domain. My angular application is on authentication.elso.org and auth0 custom domain is auth.elso.org. Here is the screenshoot. We are on enterprise plan.
Also cacheLocation: ‘localstorage’ for provideAuth0 is required for this to work. Refresh token properties were not important, i tested without them and it worked. Also, previously i had those two logins on separate routs, where first rout called ‘this.auth.loginWithRedirect()’, and i passed redirect parameter to second rout, where getAccessTokenSilently() was called, but that didnt work.
Auth0 support solution was to add custom domain in provideAuth0, ‘domain’ property, looks simple but didnt find precise explanation on that in auth0 documentation. Dont place ‘our-custom-domain.us.auth0.com’, place ‘your-custom-domain’. Also if you are validating token in backend .net for example, custom domain name must be placed there also, in ValidIssuer field, and dont use ‘https://your-custom-domain.us.auth0.com’ in there also.