The Google AdSense FAQ says:
Place ads on pages that don’t require a login.
What if the main part of your site is a password-protected member area? No AdSense? No earnings? No! Here comes a quick technique that allows you to place AdSense with content relevant ads on every page you want.
AdSense automatically delivers ads targeted to your content on a page-by-page basis. After you’ve visited a page that contains an AdSense banner, soon a bot named “Mediapartners-Google” will visit exactly that page. It’ll use exactly the same address. And it will get what the script (sites that require a login are using some kind of server-sided scripts) gives to it. That’s all we have to do. Change the content of the specific page. Mostly the script will display something like “Login required” when the Google bot comes, because it’s not logged in. Google will scan that page in order to display ads targeted to your content. That page normally won’t contain relevant content. You can change that. Add some meaningful content, and if you want to, you can put it in a div and set
display: none to hide it.
That way, you can force AdSense to display the ads you want. Create a nice keyword list, or something else. Even on pages that display e.g. some boring user details, AdSense will display relevant ads.