Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MiAuth] トークンが利用できない #6419

Closed
YuzuRyo61 opened this issue May 30, 2020 · 2 comments
Closed

[MiAuth] トークンが利用できない #6419

YuzuRyo61 opened this issue May 30, 2020 · 2 comments
Labels
⚠️bug? This might be a bug

Comments

@YuzuRyo61
Copy link
Contributor

💡 Summary

MiAuthで認証したトークンが利用できない。

🙂 Expected Behavior

MiAuthで認証したトークンを利用して認証が必要なAPIにアクセスができる。

☹️ Actual Behavior

トークンが不正というレスポンスが返る。(HTTP 403)

{
  "error": {
    "message": "Authentication failed. Please ensure your token is correct.",
    "code": "AUTHENTICATION_FAILED",
    "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14",
    "kind": "client"
  }
}

📝 Steps to Reproduce

  1. MiAuth経由で認証してトークンを取得する。
  2. 返ってきたトークンを利用して認証が必要なAPIにアクセスする

📌 Environment

Misskey v12.38.1

@syuilo
Copy link
Member

syuilo commented May 31, 2020

@YuzuRyo61
Copy link
Contributor Author

src/server/api/authenticate.ts 内の

const accessToken = await AccessTokens.findOne({
	hash: token.toLowerCase()
});

憶測で申し訳ないのですが、多分 token.toLowerCase() で小文字でデータベースを検索しているのでMiAuthで作成したトークンが見つからないのではないかと思われます

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️bug? This might be a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants