diff --git a/oauth.md b/oauth.md index de7c010..ba68a8f 100644 --- a/oauth.md +++ b/oauth.md @@ -17,6 +17,16 @@ PDS_SERVICE_DID=did:web: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)が本体となる。 > 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" ``` -## 裏でblueskyのserverを使って名前解決している +### 裏でblueskyのserverを使って名前解決している -現在のatproto-oauthは裏でblueskyのserverを使います。ですから、例えば、plc.directoryに登録されていないと成功しません。 +これは、自分のplcを使うようにすれば解決できます。 + +atproto-oauthは裏でblueskyのserverを使います。ですから、例えば、plc.directoryに登録されていないと成功しません。 ```sh # handle changeを行ったあとに更新されずdidでしかoauthできない。異なる名前で登録されている例 @@ -46,7 +58,7 @@ $ curl -sL "https://plc.directory/did:plc:6qyecktefllvenje24fcxnie" | jq '.alsoK ] ``` -## didのhandleを確認 +### didのhandleを確認 ```sh did=did:plc:6qyecktefllvenje24fcxnie