The project is a rewrite on Makerlog's approach for using gatekeeper GitHub-authentication. Instead of plain Javascript we use Angular.
This project was generated with angular-cli version 1.0.0-beta.28.3 and gatekeeper.
- Install
npm install
- Run the application
ng serve
Navigate to http://localhost:4200/
.
The app will automatically reload if you change any of the source files.
- Sign in into GitHub
- Go to settings/OAuth applications and Register a new application
- Give your application a name and fill in the Homepage URL and Authorization callback URL :
http://localhost:4200/
- Save (afterwards we will need the Client ID and Client Secret for our gatekeeper setup)
- Clone the repository into src/app/shared directory
git clone git@github.com:prose/gatekeeper.git
- Install Dependencies
cd src/app/shared && npm install
- Adjust
config.json
(src/app/shared/gatekeeper/config.json)
{
"oauth_client_id": "GITHUB_APPLICATION_CLIENT_ID",
"oauth_client_secret": "GITHUB_APPLICATION_CLIENT_SECRET",
"oauth_host": "github.com",
"oauth_port": 443,
"oauth_path": "/login/oauth/access_token",
"oauth_method": "POST",
"port": 9999
}
- Adjust
gatekeeper.config.ts
(src/app/gatekeeper.config.ts)
export const gatekeeperConfig = {
development: {
client_id: 'GITHUB_APPLICATION_CLIENT_ID',
redirect_uri: 'http://localhost:4200/auth',
gatekeeper: 'http://localhost:9999'
},
production: {}
};
-
Add Gatekeeper to
.gitignore
-
Serve
$ cd src/app/shared/gatekeeper && node server.js