Tutorial: Creating a private Developer Portal site
You can create a private version of the Developer Portal, so that authenticated users only can access content on the site. You might want to do this if you want to restrict public access to your content unless they are logged in.
Before you begin
You must have a Developer Portal enabled, and you must have administrator access to complete this tutorial. The tutorial Creating the Portal explains how to enable the portal if you have not already done so.About this tutorial
In this tutorial, you are going to restrict access for all the content to authenticated users
only. This gives access to all users from Content Author
to
Superuser
, as they are all required to authenticate to access their roles. You will
then add the login form to the home page, so that public users will be able to view the public home
page that contains the login form only.
Export your configuration settings
In case you make an error, or want to revert all of the changes made during this tutorial, you can back up your configuration settings to your machine before you make any changes.
The tutorial Exporting and importing custom themes and site configuration provides further details on how to export your configuration settings using the Developer Portal CLI.
Restrict all permissions to authenticated users
- If the administrator dashboard isn’t displayed, click Manage to display it.
- Navigate to .
- Clear all check boxes that are associated with
ANONYMOUS USER
. - Click
Save permissions
at the end of the page.
Restrict blocks to authenticated users
- If the administrator dashboard isn’t displayed, click Manage to display it.
- Navigate to .
- Find the row that is labeled
Main menu
and clickConfigure
. - Find the setting
Roles
under the categoryVisibility
. - Check the box
Authenticated user
. - Click
Save block
. - Repeat from step 3 for the
Footer menu
. - Click
Save block
.
Add login form to the home page
- If the administrator dashboard isn’t displayed, click Manage to display it.
- Navigate to .
- Click
Edit
on theWelcome
page. - Navigate to .
- Click
Add new block
. - Find and click
User login
, under theFORMS
section. - Clear the
Display title
check box. - Click
Add block
. - Rearrange the new login block so that it is underneath the
Welcome Banner
. - Click
Update and save
.
What you did in this tutorial
On your Developer Portal, you
restricted access for all the content to authenticated users only. Now when you access your home
page as an unauthenticated user, you see that the login form appears underneath the welcome banner.
Navigating to other URLs on the site presents an unauthorized
page to appear.
When you log in, the login form disappears from the home page and you are able to access all of the pages that are visible to your role.