ai/at
1
0

oauth を更新

2025-06-17 04:03:59 +00:00
parent fc34f671c2
commit fdabd468fb

@ -17,6 +17,16 @@ PDS_SERVICE_DID=did:web:syu.is
PDS_PUBLIC_URL=https://syu.is PDS_PUBLIC_URL=https://syu.is
``` ```
```js
this.oauthClient = await BrowserOAuthClient.load({
clientId: this.getClientId(),
handleResolver: pdsUrl,
plcDirectoryUrl: pdsUrl === 'https://syu.is' ? 'https://plc.syu.is' : 'https://plc.directory',
});
```
## 解説
[@atproto/oauth-provider](https://github.com/bluesky-social/atproto/tree/main/packages/oauth/oauth-provider)が本体となる。 [@atproto/oauth-provider](https://github.com/bluesky-social/atproto/tree/main/packages/oauth/oauth-provider)が本体となる。
> https://syu.is/@atproto/oauth-provider/~assets/file.css > https://syu.is/@atproto/oauth-provider/~assets/file.css
@ -26,9 +36,11 @@ curl -s https://syu.is/.well-known/oauth-authorization-server |jq .
curl -s "https://syu.is/oauth/authorize?client_id=https://syui.ai/client-metadata.json&response_type=code&redirect_uri=https://syui.ai/oauth/callback" curl -s "https://syu.is/oauth/authorize?client_id=https://syui.ai/client-metadata.json&response_type=code&redirect_uri=https://syui.ai/oauth/callback"
``` ```
## 裏でblueskyのserverを使って名前解決している ### 裏でblueskyのserverを使って名前解決している
現在のatproto-oauthは裏でblueskyのserverを使います。ですから、例えば、plc.directoryに登録されていないと成功しません これは、自分のplcを使うようにすれば解決できます
atproto-oauthは裏でblueskyのserverを使います。ですから、例えば、plc.directoryに登録されていないと成功しません。
```sh ```sh
# handle changeを行ったあとに更新されずdidでしかoauthできない。異なる名前で登録されている例 # handle changeを行ったあとに更新されずdidでしかoauthできない。異なる名前で登録されている例
@ -46,7 +58,7 @@ $ curl -sL "https://plc.directory/did:plc:6qyecktefllvenje24fcxnie" | jq '.alsoK
] ]
``` ```
## didのhandleを確認 ### didのhandleを確認
```sh ```sh
did=did:plc:6qyecktefllvenje24fcxnie did=did:plc:6qyecktefllvenje24fcxnie