jointrashposs/content/ko/docs/4.for-developers/api/token/2.miauth.md

77 lines
3.2 KiB
Markdown
Raw Normal View History

New Crowdin updates (#98) * New translations thread-mute.md (Chinese Simplified) * New translations webhook.md (Chinese Simplified) * New translations 1.troubleshooting.md (Chinese Simplified) * New translations donate.md (Chinese Simplified) * New translations misskey-hub.md (Chinese Simplified) * New translations announcement.md (Chinese Simplified) * New translations role.md (Chinese Simplified) * New translations 1.index.md (Chinese Simplified) * New translations bash.md (Chinese Simplified) * New translations docker.md (Chinese Simplified) * New translations kubernetes.md (Chinese Simplified) * New translations manual.md (Chinese Simplified) * New translations ubuntu-manual.md (Chinese Simplified) * New translations cdn.md (Chinese Simplified) * New translations disable-timelines.md (Chinese Simplified) * New translations 1.index.md (Chinese Simplified) * New translations permission.md (Chinese Simplified) * New translations 1.index.md (Chinese Simplified) * New translations 2.miauth.md (Chinese Simplified) * New translations 5.releases.md (Chinese Simplified) * New translations 1.index.md (Chinese Simplified) * New translations 3.oauth.md (Chinese Simplified) * New translations ja-jp.yml (Chinese Traditional) * New translations 1.about-misskey.md (Chinese Traditional) * New translations 2.get-started.md (Chinese Traditional) * New translations 3.join-server.md (Chinese Traditional) * New translations 4.things-to-know.md (Chinese Traditional) * New translations ads.md (Chinese Traditional) * New translations drive.md (Chinese Traditional) * New translations mfm.md (Chinese Traditional) * New translations mute-and-block.md (Chinese Traditional) * New translations pages.md (Chinese Traditional) * New translations poll.md (Chinese Traditional) * New translations share-form.md (Chinese Traditional) * New translations thread-mute.md (Chinese Traditional) * New translations webhook.md (Chinese Traditional) * New translations 1.troubleshooting.md (Chinese Traditional) * New translations donate.md (Chinese Traditional) * New translations misskey-hub.md (Chinese Traditional) * New translations announcement.md (Chinese Traditional) * New translations role.md (Chinese Traditional) * New translations 1.index.md (Chinese Traditional) * New translations bash.md (Chinese Traditional) * New translations docker.md (Chinese Traditional) * New translations kubernetes.md (Chinese Traditional) * New translations manual.md (Chinese Traditional) * New translations ubuntu-manual.md (Chinese Traditional) * New translations cdn.md (Chinese Traditional) * New translations disable-timelines.md (Chinese Traditional) * New translations 1.index.md (Chinese Traditional) * New translations permission.md (Chinese Traditional) * New translations 1.index.md (Chinese Traditional) * New translations 2.miauth.md (Chinese Traditional) * New translations publish-on-your-website.md (Chinese Traditional) * New translations 5.releases.md (Chinese Traditional) * New translations 1.index.md (Chinese Traditional) * New translations 3.oauth.md (Chinese Traditional) * New translations 1.about-misskey.md (English) * New translations 2.get-started.md (English) * New translations 3.join-server.md (English) * New translations 4.things-to-know.md (English) * New translations ads.md (English) * New translations drive.md (English) * New translations mfm.md (English) * New translations mute-and-block.md (English) * New translations pages.md (English) * New translations poll.md (English) * New translations share-form.md (English) * New translations thread-mute.md (English) * New translations webhook.md (English) * New translations 1.troubleshooting.md (English) * New translations donate.md (English) * New translations misskey-hub.md (English) * New translations announcement.md (English) * New translations role.md (English) * New translations 1.index.md (English) * New translations bash.md (English) * New translations docker.md (English) * New translations kubernetes.md (English) * New translations manual.md (English) * New translations ubuntu-manual.md (English) * New translations cdn.md (English) * New translations disable-timelines.md (English) * New translations 1.index.md (English) * New translations permission.md (English) * New translations 1.index.md (English) * New translations 2.miauth.md (English) * New translations 5.releases.md (English) * New translations 1.index.md (English) * New translations 3.oauth.md (English) * New translations 1.about-misskey.md (Indonesian) * New translations 2.get-started.md (Indonesian) * New translations 3.join-server.md (Indonesian) * New translations 4.things-to-know.md (Indonesian) * New translations ads.md (Indonesian) * New translations drive.md (Indonesian) * New translations mfm.md (Indonesian) * New translations mute-and-block.md (Indonesian) * New translations pages.md (Indonesian) * New translations poll.md (Indonesian) * New translations share-form.md (Indonesian) * New translations thread-mute.md (Indonesian) * New translations webhook.md (Indonesian) * New translations 1.troubleshooting.md (Indonesian) * New translations donate.md (Indonesian) * New translations misskey-hub.md (Indonesian) * New translations announcement.md (Indonesian) * New translations role.md (Indonesian) * New translations 1.index.md (Indonesian) * New translations bash.md (Indonesian) * New translations docker.md (Indonesian) * New translations kubernetes.md (Indonesian) * New translations manual.md (Indonesian) * New translations ubuntu-manual.md (Indonesian) * New translations cdn.md (Indonesian) * New translations disable-timelines.md (Indonesian) * New translations 1.index.md (Indonesian) * New translations permission.md (Indonesian) * New translations 1.index.md (Indonesian) * New translations 2.miauth.md (Indonesian) * New translations 5.releases.md (Indonesian) * New translations 1.index.md (Indonesian) * New translations 3.oauth.md (Indonesian) * New translations 5.releases.md (Korean) * New translations ja-jp.yml (English) * New translations docker.md (English) * New translations ja-jp.yml (Indonesian) * New translations 5.releases.md (Korean) * New translations ja-jp.yml (Indonesian) * New translations 1.about-misskey.md (Indonesian) * New translations 1.index.md (Indonesian) * New translations ads.md (Indonesian) * New translations antenna.md (Indonesian) * New translations charts.md (Indonesian) * New translations clip.md (Indonesian) * New translations custom-emoji.md (Indonesian) * New translations deck.md (Indonesian) * New translations drive.md (Indonesian) * New translations favorite.md (Indonesian) * New translations follow.md (Indonesian) * New translations hashtag.md (Indonesian) * New translations mention.md (Indonesian) * New translations mfm.md (Indonesian) * New translations 1.index.md (Indonesian) * New translations announcement.md (Indonesian) * New translations bash.md (Indonesian) * New translations ja-jp.yml (Indonesian) * New translations mute-and-block.md (Indonesian) * New translations pages.md (Indonesian) * New translations apps.md (Indonesian) * New translations donate.md (Indonesian) * New translations bash.md (Indonesian) * New translations docker.md (Indonesian) * New translations manual.md (Indonesian) * New translations 1.about-misskey.md (Chinese Traditional) * New translations 1.about-misskey.md (Chinese Traditional) * New translations create-plugin.md (French) * New translations create-plugin.md (Italian) * New translations create-plugin.md (Polish) * New translations create-plugin.md (Chinese Simplified) * New translations create-plugin.md (Chinese Traditional) * New translations create-plugin.md (Indonesian) * New translations aiscript.md (French) * New translations aiscript.md (Italian) * New translations aiscript.md (Korean) * New translations aiscript.md (Polish) * New translations aiscript.md (Chinese Simplified) * New translations aiscript.md (Chinese Traditional) * New translations aiscript.md (English) * New translations aiscript.md (Indonesian) * New translations ja-jp.yml (Chinese Traditional) * New translations ja-jp.yml (Chinese Traditional) * New translations troubleshooting.md (French) * New translations libraries.md (French) * New translations troubleshooting.md (Italian) * New translations libraries.md (Italian) * New translations troubleshooting.md (Korean) * New translations libraries.md (Korean) * New translations troubleshooting.md (Polish) * New translations libraries.md (Polish) * New translations troubleshooting.md (Chinese Simplified) * New translations libraries.md (Chinese Simplified) * New translations troubleshooting.md (Chinese Traditional) * New translations libraries.md (Chinese Traditional) * New translations troubleshooting.md (English) * New translations libraries.md (English) * New translations troubleshooting.md (Indonesian) * New translations libraries.md (Indonesian) * New translations ja-jp.yml (Chinese Traditional) * New translations ja-jp.yml (French) * New translations 2.miauth.md (French) * New translations ja-jp.yml (Italian) * New translations 2.miauth.md (Italian) * New translations ja-jp.yml (Korean) * New translations ja-jp.yml (Polish) * New translations 2.miauth.md (Polish) * New translations ja-jp.yml (Chinese Simplified) * New translations 2.miauth.md (Chinese Simplified) * New translations 2.miauth.md (Chinese Traditional) * New translations ja-jp.yml (English) * New translations 2.miauth.md (English) * New translations ja-jp.yml (Indonesian) * New translations 2.miauth.md (Indonesian) * Revert "New translations 1.about-misskey.md (English)" This reverts commit 2b9572c2cfadbc27252b1d6b1e2880e2bff712d3. * Revert "New translations 2.get-started.md (English)" This reverts commit 2fa05a5aee99ff15f9ab3ae808692b3e6f2596ef. * Revert "New translations 4.things-to-know.md (English)" This reverts commit 698c5e980d2b65942ee63128a2a1ad73442ab732. * Revert "New translations ads.md (English)" This reverts commit f0e1cd2965e2e904d4cba5eaf118b1f9adc1a1a0. * Revert "New translations mfm.md (English)" This reverts commit 51dcc0fc10f1cb32ea881e6267e12c1461110a89. * Revert "New translations webhook.md (English)" This reverts commit cfbebc57835eab30746ae9e16ac13c5e0929cc1b. * Revert "New translations 1.index.md (English)" This reverts commit 67d2bec45c2afd9a85cb3a4912f348313ece279a. * Revert "New translations disable-timelines.md (English)" This reverts commit 19ead90df6acffc95fdbd2a18809eb2a0a15249f. * Revert "New translations webhook.md (French)" This reverts commit 52e6a8429a1fb9488e2af7b08fd534028b82c16d. * Revert "New translations webhook.md (Chinese Traditional)" This reverts commit 395f0fbc4a0f99d9ebf20bc3beef812c0f271216. * Revert "New translations webhook.md (Polish)" This reverts commit ac4e2c534e623d49b53898f6ec5446762fa87591. * Revert "New translations webhook.md (Korean)" This reverts commit 14853e1eab1f5120a361cda0931fce82806a7044. * Revert "New translations pages.md (Korean)" This reverts commit f88e73d1ce3f316388f25f2368194fa1bfd632dc. * Revert "New translations bash.md (Korean)" This reverts commit 60c9fae6a87e911cef01b9afa90120100bf19e89. * Revert "New translations kubernetes.md (Korean)" This reverts commit 2239e8fd2380b1ce0faa5df219f0adc5d0a18626. * Revert "New translations ubuntu-manual.md (Korean)" This reverts commit 3aab9826258a5ab92952a898e9db124a46a1de46. * Revert "New translations 1.about-misskey.md (Chinese Traditional)" This reverts commit 5ac92102db971bbb07486b284cade6afdf1aaa90. * Revert "New translations 2.get-started.md (Chinese Traditional)" This reverts commit d090253e347f5e84a98f53292d92b3fabcc192a2. * Revert "New translations 3.join-server.md (Chinese Traditional)" This reverts commit 634db4d49b55315329b834251edcc064b37add55. * Revert "New translations 4.things-to-know.md (Chinese Traditional)" This reverts commit 383ee08013cd0eff1d71f633c04252c1197e1c81. * Revert "New translations ads.md (Chinese Traditional)" This reverts commit 6ed3b6885ff99f7cfacdbaaead8f20708ddbbc2a. * Revert "New translations drive.md (Chinese Traditional)" This reverts commit 988cacb17e1c975f4bc6d966fbe27941d8063a83. * Revert "New translations mfm.md (Chinese Traditional)" This reverts commit 6b53e36fc49bf9e0a564cf23839f14000ca584ae. * Revert "New translations mute-and-block.md (Chinese Traditional)" This reverts commit 44b1b3c723fbc0390a14e3e19078a631beddcf6f. * Revert "New translations pages.md (Chinese Traditional)" This reverts commit 4e60747a55989248765765fe4dc870878fbf2b27. * Revert "New translations poll.md (Chinese Traditional)" This reverts commit 00385dc6a120f5d3dbd79555c2b1f575f4fb74d7. * Revert "New translations share-form.md (Chinese Traditional)" This reverts commit 8858eaf2f765421e93dc794481ecbf44e485681e. * Revert "New translations thread-mute.md (Chinese Traditional)" This reverts commit d07bd700008d24aa127e39194bfa7446b861aafc. * Revert "New translations 1.troubleshooting.md (Chinese Traditional)" This reverts commit 7405a91ff95640a4d953b81737afa504c1b69cfe. * fix * New translations aiscript.md (Korean) * New translations ja-jp.yml (Chinese Traditional) * New translations troubleshooting.md (Korean) * New translations ja-jp.yml (French) * New translations ja-jp.yml (Italian) * New translations ja-jp.yml (Korean) * New translations ja-jp.yml (Polish) * New translations ja-jp.yml (Chinese Simplified) * New translations ja-jp.yml (English) * New translations ja-jp.yml (Indonesian) * New translations 5.releases.md (Korean) * fix * fix * fix * fix
2024-01-23 05:18:36 +01:00
---
description: v12.27.0 이상에서 사용할 수 있는 Misskey만의 간단한 인증 방법을 설명합니다.
---
# MiAuth 방식의 액세스 토큰 획득 방식
애플리케이션을 이용하는 사용자(이하 단순히 '사용자'라 칭함)의 액세스 토큰을 발급받으려면 아래 절차에 따라 발급을 요청합니다.
:::tip
아래 설명할 방법은 앱을 만들지 않고 즉시 액세스 토큰을 발급하는 MiAuth라는 방법입니다.
- [더 많이 사용되는 OAuth 방식으로 액세스 토큰을 획득하는 방법도 있습니다.](./oauth.md)
- [앱 생성 방식으로 액세스 토큰을 획득하는 방법도 있습니다(구식).](./app.md)
:::
## Step 1
UUID를 생성합니다.이후 이를 **세션 ID**라고 부릅니다.
:::danger
이 세션 ID는 매번 생성해야 하며, 반복해서 사용하지 않도록 해야 합니다.
:::
## Step 2
애플리케이션 인증 양식을 사용자의 브라우저에 표시하도록 합니다.인증 양식은 다음 형식의 URL로 열 수 있습니다.
```
https://misskey.io/miauth/c1f6d42b-468b-4fd2-8274-e58abdedef6f?name=MyApp&callback=https%3A%2F%2Fmyapp.example.com%2Fcallback&permission=write:notes,write:following,read:drive
```
여기서,
- `{host}`부분은 사용자 서버의 호스트로 대체합니다.보통 호스트는 사용자가 입력합니다.
- `{session}`부분은 세션 ID로 대체합니다.
사용자가 애플리케이션 접근을 허용한 후 다음 형식의 URL에 POST 요청하면 응답으로 액세스 토큰이 포함된 JSON이 반환됩니다.
| 이름 | 설명 |
| ------------ | ---------------------------------------------------------------------------------------- |
| `name` | 애플리케이션 이름. |
| `icon` | 애플리케이션 아이콘의 이미지 URL. |
| `callback` | 인증이 끝난 후 리디렉션되는 URL.<br> 리디렉션 시에는 `session`이라는 쿼리 파라미터로 세션 ID가 붙습니다. |
| `permission` | 애플리케이션이 요구하는 권한.<br> 요청하는 권한을 `,`로 구분하여 열거합니다.권한 목록은 [여기](./permission.md)에서 확인할 수 있습니다. |
:::tip{label='例'}
```
https://misskey.io/miauth/c1f6d42b-468b-4fd2-8274-e58abdedef6f?name=MyApp&callback=https%3A%2F%2Fmyapp.example.com%2Fcallback&permission=write:notes,write:following,read:drive
```
:::
## Step 3
사용자가 애플리케이션 접근을 허용한 후 다음 형식의 URL에 POST 요청하면 응답으로 액세스 토큰이 포함된 JSON이 반환됩니다.
```
https://{host}/api/miauth/{session}/check
```
여기서,
- HTTP API는 모두 POST이며, 요청/응답 모두 JSON 형식입니다(drive/files/create 제외).
- 요청 헤더에 `Content-Type: application/json`을 지정합니다.
응답에 포함된 속성은 다음과 같습니다.
| 이름 | 설명 |
| ------- | ----------- |
| `token` | 사용자 액세스 토큰. |
| `user` | 사용자 정보. |