{"id":15567213,"url":"https://github.com/iml1111/sejong-univ-auth","last_synced_at":"2025-04-24T00:03:22.003Z","repository":{"id":40453683,"uuid":"482209320","full_name":"iml1111/sejong-univ-auth","owner":"iml1111","description":"세종대학교 구성원 인증 라이브러리","archived":false,"fork":false,"pushed_at":"2023-05-29T11:56:24.000Z","size":55,"stargazers_count":34,"open_issues_count":4,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T00:03:14.051Z","etag":null,"topics":["authentication","hacktoberfest","python","sejong-university"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iml1111.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["iml1111"]}},"created_at":"2022-04-16T09:20:25.000Z","updated_at":"2025-04-09T04:12:22.000Z","dependencies_parsed_at":"2025-03-06T22:41:29.947Z","dependency_job_id":null,"html_url":"https://github.com/iml1111/sejong-univ-auth","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iml1111%2Fsejong-univ-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iml1111%2Fsejong-univ-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iml1111%2Fsejong-univ-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iml1111%2Fsejong-univ-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iml1111","download_url":"https://codeload.github.com/iml1111/sejong-univ-auth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250535088,"owners_count":21446507,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","hacktoberfest","python","sejong-university"],"created_at":"2024-10-02T17:10:22.414Z","updated_at":"2025-04-24T00:03:21.971Z","avatar_url":"https://github.com/iml1111.png","language":"Python","funding_links":["https://github.com/sponsors/iml1111"],"categories":[],"sub_categories":[],"readme":"# sejong-univ-auth ![Python versions](https://img.shields.io/badge/Python-3.7-blue) ![License](https://img.shields.io/badge/license-MIT-green) ![Release](https://img.shields.io/badge/release-0.3.4-red)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"25%\" alt=\"sejong-univ-auth image\" src=\"https://user-images.githubusercontent.com/47492535/177720510-4f7d28aa-8c3d-46a1-b28e-12e24a2e5893.png\" \u003e\n\t\u003cbr /\u003e \n\t\u003cb\u003eSejong University Member Account Authentication\u003c/b\u003e\n\t\u003cbr /\u003e \n\u003c/p\u003e\n\n세종대학교 구성원인지 확인하기 위한 간편한 인증 라이브러리입니다.\n\n**Python**이라면 아래와 같은 방법으로 쉽게 구현해보세요!\n\n혹시 **다른 언어**를 사용하시나요? 그렇다면 [저희들이 직접 개발한 REST API](https://github.com/iml1111/sejong-univ-auth#sejong-auth-api)를 사용해보세요!\n\n\u003cbr /\u003e\n\n## Easy to install\n\n**Pip**: `pip install sejong-univ-auth`\n\n**Direct:**\n\n- `git clone https://github.com/iml1111/sejong-univ-auth`\n- `python setup.py install`\n\n## Easy to use\n\n```python\n\u003e\u003e\u003e from sejong_univ_auth import auth\n\u003e\u003e\u003e result = auth(id='16011089', password='\u003cmy-password\u003e')\n\u003e\u003e\u003e result.is_auth\nTrue\n```\n\n## Usage\n\n세종대학교에는 다양한 웹 서비스가 있고, 하나의 포탈 멤버 계정을 통해 인증을 수행합니다.\n\n해당 라이브러리의 동작 방식은 **여러 웹 서비스의 인증 동작 구조를 직접 재현하여 대신해서 로그인을 수행해본 후, 해당 결과를 프로그래밍적으로 활용**할 수 있도록 돕습니다.\n\n`sejong_univ_auth`를 사용하기 위한 endpoint 함수는 아래와 같습니다.\n\n```python\ndef auth(id: str, password: str, methods: Authenticator)\n# id, password: 세종대학교 포탈에 로그인하기 위한 계정 정보입니다.\n# methods: 어떠한 인증 방식으로 인증을 시도할지 결정합니다. (default=Manual)\n```\n\n### Methods\n\n현재 사용가능한 인증 방식(Method)은 아래와 같습니다.\n\n```python\nfrom sejong_univ_auth import (\n    Manual,\n    PortalSSOToken,\n    DosejongSession,\n    MoodlerSession,\n    ClassicSession\n)\n```\n\n- **PortalSSOToken**\n\n  - 세종대학교 포탈 사이트의 인증 방식입니다.\n\n- **DosejongSession**\n\n  - dosejong 사이트의 세션 인증 방식입니다.\n  - 이름, 학과를 추가로 조회할 수 있습니다.\n\n- **ClassicSession**\n\n  - 대양휴머니티칼리지 사이트의 세션 인증 방식입니다.\n  - 함께 조회되는 추가 정보는 다음과 같습니다.\n    - 이름\n    - 학과\n    - 학년\n    - 재학/휴학/수료 상태\n    - 고전 독서 인증 현황\n\n- **MoodlerSession**\n\n  - SJULMS 사이트의 세션 인증 방식입니다.\n  - 이름, 학과를 추가로 조회할 수 있습니다.\n\n- **Manual (default)**\n  - 현재 구현된 모든 메소드를 평균 실행 속도가 빠른 순서대로 수행합니다.\n  - 인증 성공 및 id/pw 불일치로 인한 인증 실패가 반환될 때까지 순차적으로 실행합니다.\n\n메소드를 직접 지정하는 경우, 아래와 같이 사용할 수 있습니다.\n\n```python\n\u003e\u003e\u003e from sejong_univ_auth import PortalSSOToken, DosejongSession, auth\n\u003e\u003e\u003e auth(id='\u003cyour-id\u003e', password='\u003cyour-pw\u003e', methods=PortalSSOToken)\n\u003e\u003e\u003e auth(id='\u003cyour-id\u003e', password='\u003cyour-pw\u003e', methods=DosejongSession)\n...\n# 복수의 Authenticator를 순차적으로 수행할 경우\n\u003e\u003e\u003e auth(id='\u003cyour-id\u003e', password='\u003cyour-pw\u003e', methods=[PortalSSOToken, DosejongSession])\n```\n\n복수의 Authenticator를 list(혹은 tuple) 형태로 주게 될 경우, 순차적으로 메소드를 수행합니다.\n\n만약 현재의 메소드에서 현재 인증이 불가능한(Internel Sever Error 등의) 상황일 경우, 바로 다음 메소드로 시프트하여 인증을 진행합니다.\n\n### AuthResponse\n\n인증의 결과는 Nametuple의 형태로 반환됩니다.\n\n```python\nAuthResponse(\n\tsuccess=True,\n\tis_auth=True,\n\tstatus_code=200,\n\tcode='success',\n\tbody={\n\t\t'name': '신희재',\n\t\t'major': '컴퓨터공학과'\n\t},\n\tauthenticator='DosejongSession'\n)\n```\n\n- **success: 인증 서버 정상 동작 여부**\n\n  - 해당 인증 절차에 대하여 서버는 정상적인 결과를 반환하였습니다.\n  - Value: True / False\n\n- **is_auth: 인증 성공 여부**\n\n  - id/pw가 정확하더라도 서버의 상태 이상 및 인증 포맷이 갱신되어 라이브러리의 방식과 상이할 경우 인증 성공을 반드시 보장할 수 없습니다.\n  - 인증 결과를 알 수 없을 경우, None이 반환됩니다.\n  - Value: True / False / None\n\n- **status_code: 인증 서버의 HTTP status code**\n  - Value: int\n- **code: Authenticator 반환 코드**\n  - 인증이 성공할 경우, 'success'로 통일합니다.\n  - 인증이 실패 및 알 수 없을 경우, 각각의 분기에 맞는 코드 값을 반환합니다.\n  - Value: string\n- **body: 메타데이터**\n  - 인증 결과에 관련된 메타데이터를 포함합니다.\n    - 인증 실패시의 보다 정확한 실패 사유\n    - 이름/학번/학년/재학 상태 등의 추가 정보\n  - Value: dict\n- **authenticator: 해당 인증에 사용된 Authenticator 클래스**\n\n\u003cbr /\u003e\n\n# Sejong Auth API\n\nJava, Node 등 다른 언어를 사용중이신 학우분들을 위해 저희들이 개발한 REST API를 사용하실 수 있습니다.\n\n- **단, 해당 API의 경우, 지속적인 지원을 보장할 수 없습니다.**\n\n### Request\n\n**method**의 경우, 기존에 사용가능한 메소드를 \"Manual\", \"DosejongSession\"과 같은 형식으로 그대로 입력해주시면 됩니다. 복수의 메소드에 대한 순차적인 호출은 현재 지원되지 않습니다.\n\n```javascript\nPOST https://auth.imsejong.com/auth?method=\u003c사용하고자 하는 메소드\u003e HTTP/1.1\nHost: auth.imsejong.com\n{\n    \"id\": \"\u003c학번\u003e\",\n    \"pw\": \"\u003c비밀번호\u003e\"\n}\n```\n\n### Response\n\n```javascript\n{\n    \"msg\": \"success\",\n    \"result\": {\n        \"authenticator\": \"DosejongSession\",\n        \"body\": {\n            \"major\": \"컴퓨터공학과\",\n            \"name\": \"신희재\"\n        },\n        \"code\": \"success\",\n        \"is_auth\": true,\n        \"status_code\": 200,\n        \"success\": true\n    },\n    \"version\": \"0.3.4\"\n}\n```\n\n\u003cbr /\u003e\n\n# Contributors\n\n컨트리뷰트를 원하신다면 [가이드라인](https://github.com/iml1111/sejong-univ-auth/blob/main/CONTRIBUTING.md)을 참고해주세요! 감사합니다! 😀\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/iml1111/sejong-univ-auth/graphs/contributors\"\u003e\n  \t\u003cimg src=\"https://contrib.rocks/image?repo=altmshfkgudtjr/python-oauth-kakao\" /\u003e\n\t\u003c/a\u003e\n\t\u003cbr /\u003e \n\u003c/p\u003e\n\u003cbr /\u003e\n\n# References\n\n- https://pypi.org/project/sejong-univ-auth/\n- https://auth.imsejong.com/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiml1111%2Fsejong-univ-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiml1111%2Fsejong-univ-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiml1111%2Fsejong-univ-auth/lists"}