https://github.com/shapelayer/oauth2example-flask-only
Oauth2 로그인 예제
https://github.com/shapelayer/oauth2example-flask-only
Last synced: 12 months ago
JSON representation
Oauth2 로그인 예제
- Host: GitHub
- URL: https://github.com/shapelayer/oauth2example-flask-only
- Owner: ShapeLayer
- Created: 2018-10-12T13:13:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-07T13:25:39.000Z (about 7 years ago)
- Last Synced: 2025-02-14T22:45:52.495Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Oauth2Example-Flask-only
Flask로 Oauth2 인증 절차를 밟아보는 예제입니다. 모듈 의존성을 최대한 줄인 코드를 찾아봤지만 찾지 못해 작성했으며, ```Flask-Social```모듈을 사용하지 않았습니다.
## 시작하기
### 파이썬 설치
[파이썬 설치 가이드](https://github.com/404-sdok/how-to-python/blob/master/0.md)를 보며 파이썬을 설치합니다.
### 모듈 설치
Windows 환경이라면 ```pip install Flask```, Linux 환경이라면 ```pip3 install Flask```를 입력합니다.
### 애플리케이션 실행
다음 명령어로 실행합니다.
```python (파일명)``` 또는 ```python3 (파일명)```
* `client_id`와 `client_secret`은 예제가 정상 작동할수 있도록 채워두었으며, 실 사용시 각 제공자의 설정값에 맞게 변경하면 됩니다.
* `get_token`디렉토리 내 코드는 액세스토큰을 받아 사용자 정보를 불러오고 마무리됩니다. `refresh`디렉토리 내 코드는 refresh 토큰으로 액세스토큰을 갱신하는 코드도 포함되어 있으며, 더 복잡합니다.
### 로컬호스트 접속
[http://localhost:2500](http://localhost:2500)에 접속합니다.