前提
マストドンAPIの利用で認証コードの手入力を省くためにリダイレクトURIを指定して取得したい。
実現したいこと
リダイレクトURIに何を指定したらいいのか知りたい。
発生している問題・エラーメッセージ
無効なリダイレクトURIです。
試したこと
参考サイトよりユーザー承認後に飛ばすリダイレクト先のアドレスを指定します
とあるので
https://mstdn.jp/web/home
を入力しましたがエラーになりました。
参考サイト
参考サイト https://www.antun.net/tips/api/mastodon.html#authentication
リファレンス https://docs.joinmastodon.org/methods/apps/oauth/
該当のソースコード
cs
1/*################################################################################################################## 2 * コンストラクタ 3 ###################################################################################################################*/ 4 public Client(string client_id,string url) 5 { 6 instance = url; 7 client = new HttpClient(); 8 client.DefaultRequestHeaders.UserAgent.Add(ProductInfoHeaderValue.Parse("test/1.0")); 9 10 //Process.Start("explorer.exe", $"\"https://{instance}/oauth/authorize?client_id={client_id}&scope=read&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code\""); 11 Process.Start("explorer.exe", $"\"https://{instance}/oauth/authorize?client_id={client_id}&scope=read&redirect_uri=XXXXXXXXXXXX&response_type=code\""); 12 Console.Write("Input code: "); 13 14 //auth_code = "xsV4AOuf3gCkQrXj4ofv5IQj5mJJZAsqfkptwWo21nI"; 15 auth_code = Console.ReadLine(); 16 17 } 18
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。