【问题标题】:OAuth2.0 integration with XamarinOAuth2.0 与 Xamarin 的集成
【发布时间】:2019-03-26 01:19:05
【问题描述】:
  1. 我们使用“Microsoft.AspNet.Identity.Owin”和“Microsoft.Owin”框架构建自己的“OWIN OAuth 2.0 授权服务器”。参考:https://docs.microsoft.com/en-us/aspnet/aspnet/overview/owin-and-katana/owin-oauth-20-authorization-server

  2. 我们可以使用“DotNetOpenAuth.OAuth2.Client”向我们的自定义 OAuth2.0 服务器发送请求并从 Web 应用程序获取 OAuth2.0 访问令牌。

  3. 此外,我们可以成功地将我们的自定义 OAuth2.0 服务器与 Cortana bot 通道集成,并且工作正常。

  4. 但是,在将我们的自定义 OAuth2.0 服务器与 Xamarin 移动应用程序集成时,我们面临与 redirect_uri 相关的问题。我们收到类似 invalid_grant 的响应。

  5. 我们在 Xamarin 中使用“Xamarin.Auth”框架来发送 OAuth 请求。

  6. 这是我们在 Web 和 Mobile 中使用的 redirect_uri

    一个。 Xamarin 应用程序 redirect_uri: com.Demo.Mobile:/oauth2redirect

    b.网址redirect_uri:https://demowebsite.azurewebsites.net/

https://user-images.githubusercontent.com/5037741/54964768-10d0ca80-4f44-11e9-9fd9-92673f07f919.png

在此先感谢您的帮助:)

【问题讨论】:

  • 请将相关代码添加到您的问题中。

标签: xamarin oauth-2.0 owin


【解决方案1】:

我们通过使用此 redirect_uri 模式 oauth2redirect:/com.company.package/ 解决了这个问题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-09-19
    • 1970-01-01
    • 2017-04-03
    • 1970-01-01
    • 2015-03-04
    • 2019-03-15
    • 2021-12-08
    相关资源
    最近更新 更多