简体   繁体   English

如何在WebApi中验证XboxLive用户

[英]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! 谢谢!

For XAL you need to be in a managed partner program as a pre-requisite (ID@Xbox). 对于XAL,您需要在托管合作伙伴计划中作为先决条件(ID @ Xbox)。 The Creators Program doesn't qualify for that. 创作者计划不符合此条件。

XAL文档的屏幕截图

For OpenXbox you may put your question to the developers at GitHub 对于OpenXbox,您可以将问题提交给GitHub的开发人员

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用来自WebAPI的域的用户对WebAPI上不同计算机上的客户端进行身份验证? - how can authenticate a client on a different machine on a WebAPI with a user from WebAPI's domain? 如何从托管在单独服务器上的前端客户端使用 Windows Active Directory 对 .Net Core WebAPI 中的用户进行身份验证? - How to authenticate a user in a .Net Core WebAPI using Windows Active Directory from a frontend client that is hosted on a separate server? 使用WebApi通过ADFS进行身份验证 - Using WebApi to authenticate with ADFS 如何验证ASPF WebAPI 2的WPF客户端请求 - How to authenticate WPF Client request to ASP .NET WebAPI 2 如何使用 OAuth 和一个 WebAPI 对不同类型的应用程序进行身份验证 - How to authenticate different type of applications using OAuth and one WebAPI 如何使用 Blazor 服务器对用户进行身份验证 - How to authenticate a user with Blazor Server 如何在不登录的情况下验证用户身份 - How to authenticate user without login 如何根据证书对用户进行身份验证? - How to authenticate a user based on a certificate? 如何认证用户? - How can I authenticate a user? 如何使用哈希密码对用户进行身份验证? - How to authenticate user with hashed password?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM