[英]How to authenticate XboxLive user in WebApi
I have a working Xbox UWP app via the XboxLive Creators Program, which authenticates an XboxLiveUser using the SignInSilentlyAsync and SignInAsync methods demonstrated in Microsoft's documentation. 我有一个通过XboxLive Creators程序运行的Xbox UWP应用程序,该程序使用Microsoft文档中演示的SignInSilentlyAsync和SignInAsync方法对XboxLiveUser进行身份验证。
I would like my Xbox application to call my WebApi backend, and have that project authenticate the caller. 我希望我的Xbox应用程序调用我的WebApi后端,并让该项目验证调用者。 In other applications, I use OAuth and simply pass in the (previously authenticated) user's tokens, and the WebApi simply validates the token and returns unauthorized when it is not valid.
在其他应用程序中,我使用OAuth并简单地传入(先前经过身份验证的)用户的令牌,而WebApi只是验证令牌并在无效时返回未授权。 However, I'm not seeing how to do that when called from the Xbox code.
但是,从Xbox代码调用时,我没有看到如何做到这一点。
I have looked at OpenXbox ( https://github.com/OpenXbox/xbox-webapi-csharp ), and the XAL ( https://docs.microsoft.com/en-us/gaming/xbox-live/get-started/add-signin-code/getting-xsapi-to-sign-in ). 我看过OpenXbox( https://github.com/OpenXbox/xbox-webapi-csharp )和XAL( https://docs.microsoft.com/en-us/gaming/xbox-live/get-started / add-signin-code / getting-xsapi-to-sign-in )。 Both of these seem to need an interactive UI to login the user, but from a WebApi context, an interactive login is not possible.
这两者似乎都需要交互式UI来登录用户,但是从WebApi上下文中,无法进行交互式登录。
I feel I'm missing something obvious... Can anyone offer a suggestion on how to do this authentication? 我觉得我错过了一些明显的东西......任何人都可以就如何进行身份验证提出建议吗?
Thanks! 谢谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.