GitHub Pages Authentication (GHPA) allows a GitHub Pages website to be used as a secure front-end for content stored in a private GitHub repository. This website demonstrates using GHPA.
For details on GHPA, see https://github.com/scheidelg/ghpa.
| The listed pages demonstrate some (but not all) of the ways to use GHPA to access content in the private GitHub repository. |
|---|
| Description | Public File | Private Repo | Private File | Login Form | SSO? | Auth Only? | Only Get <body>? |
|---|---|---|---|---|---|---|---|
| Public stub file, corresponding private file
The stub file exists in the public repository and a corresponding private file exists in the private repository. |
file1.html | (global) | (default) | (global) | (global) | (global) | (global) |
| Public stub file, corresponding private file, no SSO
The stub file exists in the private repository and a corresponding private file exists in the private repository. However, the public stub file explicitly includes a flag to not use or cache credentials. |
file2.html | (global) | (default) | (global) | N | (global) | (global) |
| Public stub file, corresponding private file, different login form
The stub file exists in the public repository and a corresponding private file exists in the private repository. This example uses a different login form. |
file3.html | (global) | (default) | loginform-right.html | (global) | (global) | (global) |
| Public stub file, different private file via absolute path
The stub file exists in the public repository but explicitly identifies a different file to load from the private repository. The file is identified with an absolute path. |
explicit.html | (global) | /examples/file4.html | (global) | (global) | (global) | (global) |
| Public stub file, different private file via relative path
The stub file exists in the public repository but explicitly identifies a different file to load from the private repository. The file is identified with a relative path. |
file5.html | (global) | sub/file5.html | (global) | (global) | (global) | (global) |
| Public stub file, no corresponding private file
The stub file exists in the public repository but there's no corresponding file in the private repository. |
no_file.html | (global) | (none) | (global) | (global) | (global) | (global) |
| Public stub file, different private repository
The stub file exists in the public repository but explicitly identifies a different private repository to load the private file from. |
file4.html | ghpa-private-2 | (default) | (global) | (global) | (global) | (global) |
| Public stub file, different private repository, different file in same directory
The stub file exists in the public repository but explicitly identifies a different private repository from which to load a different private file. The file is identified only by it's filename, meaning that the file will be retrieved from the same relative directory as the public stub file. |
file1_repo2.html | ghpa-private-2 | file1.html | (global) | (global) | (global) | (global) |
| Login to GitHub
Access the login page to authenticate to GitHub and cache credentials, without actually loading a private file. This is useful only to establish authentication for SSO. |
login.html | (global) | (none) | (global) | (global) | Y | (global) |
| Logout of the private repository
Clear cached credentials so the user has to authenticate again to access content from the private repository. |
logout.html | (global, n/a) | (none) | (global, n/a) | (global, n/a) | (global, n/a) | (global, n/a) |
| These are the currently configured global GHPA configuration options and variables. |
|---|
| Description | Variable | Value | Page Can Override? |
|---|---|---|---|
| Current GitHub and GHPA SSO user ID | ghpaUserID | Y | |
| GitHub Organization
The GitHub organization that will be used unless overridden on a specific web page. |
ghpaOrg | Y | |
| GitHub Repository
The GitHub repository that will be used unless overridden on a specific web page. |
ghpaRepo | Y | |
| GitHub Branch
The GitHub branch that will be used unless overridden on a specific web page. |
ghpaBranch | Y | |
| Default HTML File
The HTML file to retrieve from the private GitHub repository if the browsing a GitHub Pages directory. |
ghpaDefaultHTMLfile | Y | |
| File to Retrieve
The name of the file to retrieve from the private GitHub repository. This should always be empty in the global configuration. |
ghpaFilename | Y | |
| Login Form File
The HTML file to load as the login form when the user needs to authenticate to GitHub. |
ghpaLoginFormFile | Y | |
| Flag: GitHub Tokens Only
Should the password be required to match the format of a GitHub personal access token string? |
ghpaTokensOnlyFlag | N | |
| Flag: Single Sign-on (SSO)
Should successful authentication cause GitHub credentials to be remembered and used for later authentication (so that the user doesn't have to continually re-enter the credentials)? |
ghpaSSOFlag | Y | |
| Flag: Authentication Only
Should a public stub file should only perform a GitHub authentication check (e.g., authentication-only) vs. loading a page from the private GitHub repository? |
ghpaAuthOnlyFlag | Y | |
| Flag: Only Render Retreived Body
After retrieving content from a private GitHub repository file, should we check the retrieved content for <body></body> tags and only render that content, vs. rendering all the retrieved content? |
ghpaOnlyGetBodyFlag | Y |