- This example use
ejs
template engine. While the original example is based onhbs
. - This example demonstrates how to use Express 4.x and Passport-42 to authenticate users using 42 OAuth 2.0 API. Use this example as a starting point for your own web applications.
To install this example on your computer, clone the repository and install dependencies.
$ git clone [email protected]:innovationacademy-kr/42oauth.git
$ cd 42oauth
$ npm install
Start a mysql server instance.
$ docker run --name 42oauth-mysql -e MYSQL_ROOT_PASSWORD=mysql -d -p 3306:3306 mysql
Register an app on 42 intra
and set the redirect URI to http://localhost:3000/login/42/return
.
Copy .env.sample
to .env
and edit CLIENT_ID and CLIENT_SECRET info.
Start the server.
$ npm run start
Open a web browser and navigate to http://localhost:3000/ to see the example in action.
이 문서는 CC0 (Public Domain, 크리에이티브 커먼즈 권리 포기)로 누구나 영리적인 목적을 포함한 어떤 목적으로든 그리고 어떤 방법으로든 마음대로 사용할 수 있습니다.