A Google AdSense post shares an old tip to AdSense publishers about how Google can return relevant ads even when there is a login required to see the ad.
The issue is, Google's ad targeting feature works by sending a Google spider to read the page. If the spider/bot cannot read the page, the ads might not be on target to the content on the page.
The way around that is to give Google's ad bot a way to read the page behind the login.
To grant the AdSense crawler access, log in to your AdSense account and click on 'Account settings.' From there, scroll down to the 'Access and authorization' section and click on 'edit logins' next to crawler logins.
Then click on 'Add a Login.' You'll be prompted to fill in pertinent information that the AdSense crawler will use to log in to your site and crawl your content.
After that, you'll need to log in to Webmaster Tools to verify your website, if you haven't already done so. Once verified, the crawler will be able to log in successfully and scan your content to deliver more targeted ads.
Again, this is not new, it is pretty old but a reminder doesn't hurt.
Forum discussion at WebmasterWorld.