AMP page with basic authentication

591 views Asked by At

I have an AMP page which my client wants to test before we release it. We secure our client testing environment using basic authentication.

I'm using an AMP list with a JSON src attribute to template my list

<amp-list width="auto" height="720" layout="fixed-height" src="/amp/_data/mydata.json">
    <template type="amp-mustache" id="amp-template-id">
        <div>
            <a href="{{url}}">{{linkText}}</a>
        </div>
    </template>
</amp-list>

When I load this page in Chrome the server responds with a 401, which suggests that assets on the page aren't being loaded using the basic authentication credentials used for the AMP page.

Without specifying the username and password in the URL (eg. http://user:[email protected]...) is there any way I can get additional requests to be made using the same basic authentication credentials as the AMP page?

1

There are 1 answers

0
Daniel Downs On

It may be because you are using a relative URL for your JSON data?

It's my understanding that AMP generally discourages this because it won't be the correct link if the AMP page is delivered from AMP Cache.