2
votes

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
Which basic authentication technique are you using for the AMP page?kul3r4
@kul3r4 What do you mean by technique in this context? I'm using HTTP Basic authenticationJim Jeffries
You might want to check their tutorial - Create a login-requiring AMP page, this show how to implement authentication in an AMP page. Their is also an extension that is under active development amp-access that you might want to check. Hope this info helps.Mr.Rebot

1 Answers

0
votes

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.