Can I protect my Github website with a password? #60690
Replies: 4 comments
-
There are alternative approaches you can consider adding authentication or password protection to your static website hosted on GitHub Pages: Move to a different hosting provider: Consider using a different hosting provider that supports or password protection for static websites. Netlify, for example, offers built-in password protection for static sites. It's really a better choice when you need authentication or password protection to your website. Use a third-party service: You can use a third-party service like Cloudflare Access or Firebase to add authentication layers to your GitHub Pages site. These services act as a proxy between the user and your website, requiring before granting access. If you just need to add extra security to your site, you can visit this example with Cloudflare. Implement your own system: You can build your own system using server-side technologies. However, this would require moving away from GitHub Pages and hosting your site on a server that supports server-side scripting languages like PHP, Node.js, or Python. You can use some free hosts like Heroku Hope you got your answer |
Beta Was this translation helpful? Give feedback.
-
If you're part of an enterprise, you could add access control to your GitHub pages |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
In this pretty similar question I came up with this solution: I encountered the same challenge when trying to protect an MkDocs Material static site with authentication. After some research and testing, I found a way to solve this using OAuth2 Proxy with GitHub authentication. I've documented my approach in this repository: meadapt/login-static-site. Key Points of My Solution:
1. Clone the Repositorygit clone https://github.com/meadapt/login-static-site.git
cd login-static-site
# Poetry
poetry install 2. Create Your Static SitePlace your MkDocs content inside the # Using Poetry to view your site locally
poetry run task serve
git add .
git commit -m "Add my documentation"
git push origin main This push will trigger the 3. Set Up an OAuth App on GitHubTo enable authentication, you need to create an OAuth App on GitHub:
4. Deploy the Web Service on Render
Once deployed, your site will be protected, requiring a GitHub login to access it. If you’re looking for more details, check out the repository. The |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Can I protect my static Github website (also using Jekyll) with a password - or build in any other kind of authentication feature?
Body
Beta Was this translation helpful? Give feedback.
All reactions