[英]C# - I want to join two data tables. Can you provide me a linq code segment?
[英]I want to integrate XERO to WebAPI C# Can someone provide me sample code for oauth2
我已經嘗試過以下
XeroConfiguration xeroConfig = new XeroConfiguration();
xeroConfig.ClientId = "****";
xeroConfig.ClientSecret = "****";
xeroConfig.CallbackUri = new Uri("http://localhost"); //default for standard webapi template
xeroConfig.Scope = "openid profile email files accounting.transactions accounting.contacts offline_access";
var client2 = new XeroClient(xeroConfig, httpClientFactory);
var test = client2.BuildLoginUri();
return Redirect(client2.BuildLoginUri());
重定向后,它給出以下錯誤錯誤代碼:500 錯誤:未授權客戶端:無效的 redirect_uri
這是因為您使用不同的重定向 URI 在授權服務器中注冊了您的應用程序,並且在上面您使用了不同的重定向 URI,該 URI 將由授權服務器進行驗證,並且在不匹配時,它會向您拋出錯誤。
您必須使用您將使用的重定向 URI 注冊您的應用程序
例如:如果您的應用程序在http://localhost:6500
中運行,並且您接收令牌和進程的重定向 URI 是http://localhost:6500/login
。 您必須將此值提供給授權服務器。
例如:設置看起來像
xeroConfig.CallbackUri = new Uri("http://localhost:6500/login")
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.