# sangmyung-univ-auth ![Python versions](https://img.shields.io/badge/Python-3.9-blue) ![License](https://img.shields.io/badge/license-MIT-green) ![Release](https://img.shields.io/badge/release-1.2.2-red)
**상명대학교 재학생 인증 라이브러리**
## Features
- 상명대학교 재학생 여부를 간편하게 확인하는 라이브러리입니다.
- 재학생 인증 방식은 상명대학교 포털 SSO 인증 방식입니다.
## Easy to install
**Pip**: `pip install sangmyung-univ-auth`
**Direct:**
- `git clone https://github.com/hyunmin0317/sangmyung-univ-auth`
- `python setup.py install`
## Easy to use
```python
>>> from sangmyung_univ_auth import auth
>>> result = auth('201911019', '<my-password>')
>>> result
AuthResponse(is_auth=True, code='success', body={'name': '최현민', 'department': '컴퓨터과학전공', 'email': 'choihm9903@naver.com'})
>>> result.is_auth
True
>>> result.code
'success'
>>> result.body
{'name': '최현민', 'department': '컴퓨터과학전공', 'email': 'choihm9903@naver.com'}
```
## AuthResponse
```python
AuthResponse(
is_auth=True,
code='success',
body={
'name': '최현민',
'department': '컴퓨터과학전공',
'email': 'choihm9903@naver.com'
}
)
```
- **is_auth**: 인증 성공 여부
- Type: bool
- Value
- True: 인증 성공
- False: 인증 실패
- **code**: Authenticator 반환 코드
- Type: str
- Value
- 'success': 인증에 성공할 경우
- 'auth_failed': 인증에 실패할 경우
- 'unknown_issue': 기타 라이브러리 오류
- **body**: 메타데이터
- Type: dict
- Key
- name: 이름
- department: 학과
- email: 이메일
## Sangmyung University Auth API
- **Request**
- **URL**
```text
https://smunity.co.kr/api/auth
```
- **Method**
`POST`
- **Body**
```json
{
"username": "<학번>",
"password": "<비밀번호>"
}
```
- **Response**
- **Success**: 200 OK
```json
{
"is_auth": true,
"code": "success",
"body": {
"name": "최현민",
"department": "컴퓨터과학전공",
"email": "choihm9903@naver.com"
}
}
```
- **Fail**: 401 Unauthorized
```javascript
{
"is_auth": false,
"code": "auth_failed",
"body": {
"message": "아이디 및 비밀번호가 일치하지 않습니다."
}
}
```
## References
- https://github.com/hyunmin0317/sangmyung-univ-auth
- https://pypi.org/project/sangmyung-univ-auth/
- https://smunity.co.kr/api/auth
Raw data
{
"_id": null,
"home_page": "https://github.com/hyunmin0317/sangmyung-univ-auth",
"name": "sangmyung-univ-auth",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "sangmyung univ auth",
"author": "Choi Hyun Min",
"author_email": "choihm9903@naver.com",
"download_url": "https://files.pythonhosted.org/packages/10/e6/f89cced82ba3679e9c4ca9dde688b217e2057ded56b05f84df17c1674b51/sangmyung-univ-auth-1.2.2.tar.gz",
"platform": "any",
"description": "# sangmyung-univ-auth ![Python versions](https://img.shields.io/badge/Python-3.9-blue) ![License](https://img.shields.io/badge/license-MIT-green) ![Release](https://img.shields.io/badge/release-1.2.2-red)\n**\uc0c1\uba85\ub300\ud559\uad50 \uc7ac\ud559\uc0dd \uc778\uc99d \ub77c\uc774\ube0c\ub7ec\ub9ac**\n\n## Features\n- \uc0c1\uba85\ub300\ud559\uad50 \uc7ac\ud559\uc0dd \uc5ec\ubd80\ub97c \uac04\ud3b8\ud558\uac8c \ud655\uc778\ud558\ub294 \ub77c\uc774\ube0c\ub7ec\ub9ac\uc785\ub2c8\ub2e4.\n- \uc7ac\ud559\uc0dd \uc778\uc99d \ubc29\uc2dd\uc740 \uc0c1\uba85\ub300\ud559\uad50 \ud3ec\ud138 SSO \uc778\uc99d \ubc29\uc2dd\uc785\ub2c8\ub2e4.\n\n## Easy to install\n**Pip**: `pip install sangmyung-univ-auth`\n\n**Direct:**\n- `git clone https://github.com/hyunmin0317/sangmyung-univ-auth`\n- `python setup.py install`\n\n## Easy to use\n```python\n>>> from sangmyung_univ_auth import auth\n>>> result = auth('201911019', '<my-password>')\n>>> result\nAuthResponse(is_auth=True, code='success', body={'name': '\ucd5c\ud604\ubbfc', 'department': '\ucef4\ud4e8\ud130\uacfc\ud559\uc804\uacf5', 'email': 'choihm9903@naver.com'})\n>>> result.is_auth\nTrue\n>>> result.code\n'success'\n>>> result.body\n{'name': '\ucd5c\ud604\ubbfc', 'department': '\ucef4\ud4e8\ud130\uacfc\ud559\uc804\uacf5', 'email': 'choihm9903@naver.com'}\n```\n\n## AuthResponse\n```python\nAuthResponse(\n is_auth=True,\n code='success',\n body={\n 'name': '\ucd5c\ud604\ubbfc', \n 'department': '\ucef4\ud4e8\ud130\uacfc\ud559\uc804\uacf5', \n 'email': 'choihm9903@naver.com'\n }\n)\n```\n\n- **is_auth**: \uc778\uc99d \uc131\uacf5 \uc5ec\ubd80\n - Type: bool\n - Value\n - True: \uc778\uc99d \uc131\uacf5\n - False: \uc778\uc99d \uc2e4\ud328\n- **code**: Authenticator \ubc18\ud658 \ucf54\ub4dc\n - Type: str\n - Value\n - 'success': \uc778\uc99d\uc5d0 \uc131\uacf5\ud560 \uacbd\uc6b0\n - 'auth_failed': \uc778\uc99d\uc5d0 \uc2e4\ud328\ud560 \uacbd\uc6b0\n - 'unknown_issue': \uae30\ud0c0 \ub77c\uc774\ube0c\ub7ec\ub9ac \uc624\ub958\n- **body**: \uba54\ud0c0\ub370\uc774\ud130\n - Type: dict \n - Key\n - name: \uc774\ub984\n - department: \ud559\uacfc\n - email: \uc774\uba54\uc77c\n\n## Sangmyung University Auth API\n\n- **Request**\n - **URL**\n ```text \n https://smunity.co.kr/api/auth\n ```\n - **Method**\n `POST`\n - **Body**\n ```json\n {\n \"username\": \"<\ud559\ubc88>\",\n \"password\": \"<\ube44\ubc00\ubc88\ud638>\"\n }\n ```\n\n- **Response**\n - **Success**: 200 OK\n ```json\n {\n \"is_auth\": true,\n \"code\": \"success\",\n \"body\": {\n \"name\": \"\ucd5c\ud604\ubbfc\",\n \"department\": \"\ucef4\ud4e8\ud130\uacfc\ud559\uc804\uacf5\",\n \"email\": \"choihm9903@naver.com\"\n }\n }\n ```\n - **Fail**: 401 Unauthorized\n ```javascript\n {\n \"is_auth\": false,\n \"code\": \"auth_failed\",\n \"body\": {\n \"message\": \"\uc544\uc774\ub514 \ubc0f \ube44\ubc00\ubc88\ud638\uac00 \uc77c\uce58\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.\"\n }\n }\n ```\n\n## References\n- https://github.com/hyunmin0317/sangmyung-univ-auth\n- https://pypi.org/project/sangmyung-univ-auth/\n- https://smunity.co.kr/api/auth\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Sangmyung University Students Account Authentication.",
"version": "1.2.2",
"project_urls": {
"Homepage": "https://github.com/hyunmin0317/sangmyung-univ-auth"
},
"split_keywords": [
"sangmyung",
"univ",
"auth"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c9a4488badb9ac50046f1e88628deb9eaf8c6a9be5a0207495809302066c39c7",
"md5": "8b1030be6216574d9a1759b9f3a58eee",
"sha256": "0025ddbfa06550cacd3a80634e3d4facc4cb13915fa983b0e624029ae1baaa28"
},
"downloads": -1,
"filename": "sangmyung_univ_auth-1.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8b1030be6216574d9a1759b9f3a58eee",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 6832,
"upload_time": "2024-02-15T11:11:28",
"upload_time_iso_8601": "2024-02-15T11:11:28.962167Z",
"url": "https://files.pythonhosted.org/packages/c9/a4/488badb9ac50046f1e88628deb9eaf8c6a9be5a0207495809302066c39c7/sangmyung_univ_auth-1.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "10e6f89cced82ba3679e9c4ca9dde688b217e2057ded56b05f84df17c1674b51",
"md5": "e6a56e5241f8592c28ef4466a61e7e0c",
"sha256": "28500e7ad20286d40278ccf5a085f4c52ecf20c53ec14d35b74e3655223772b3"
},
"downloads": -1,
"filename": "sangmyung-univ-auth-1.2.2.tar.gz",
"has_sig": false,
"md5_digest": "e6a56e5241f8592c28ef4466a61e7e0c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 5188,
"upload_time": "2024-02-15T11:11:30",
"upload_time_iso_8601": "2024-02-15T11:11:30.510791Z",
"url": "https://files.pythonhosted.org/packages/10/e6/f89cced82ba3679e9c4ca9dde688b217e2057ded56b05f84df17c1674b51/sangmyung-univ-auth-1.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-15 11:11:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hyunmin0317",
"github_project": "sangmyung-univ-auth",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "sangmyung-univ-auth"
}