Search code examples
htmlauthenticationiphtml-helper

Allowing specific people to view a github html site


How to allow specific people in your HTML site withouth Login? Im trying to do a site that only allows friends in my school to view my site. The persons that are not allowed will only see a white screen. Mostly because im doing a github site and i dont know how to do a login page. But when i tried to do a site that only allows specific IP's, i didn't know how to do it either...Can someone help me please? PS: My school uses the same chromebooks.

I tried to do a IP's only but then noticed that the school wifi is the same IP...


Solution

  • Github Pages does not support any server-side logic. You cannot use IP based authentication with it. You cannot do any kind of login feature with it.

    The closest you could come would be to encrypt the contents of the documents using an algorithm that could only be decrypted with a specific secret. Then write JavaScript to prompt the user for that secret and use it to decrypt the payload and modify the DOM with it.

    Then you'd need to distribute the secret among all the people who should have access to it.

    This wouldn't be a good approach since it requires sharing the secret (violating the first rule of responsible password security).

    It probably violates your "without login" restriction too.