XboxAuthNet 3.0.0-beta.1
.NET 5.0
This package targets .NET 5.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.7.2
This package targets .NET Framework 4.7.2. The package is compatible with this framework or higher.
This is a prerelease version of XboxAuthNet.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package XboxAuthNet --version 3.0.0-beta.1
NuGet\Install-Package XboxAuthNet -Version 3.0.0-beta.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="XboxAuthNet" Version="3.0.0-beta.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add XboxAuthNet --version 3.0.0-beta.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: XboxAuthNet, 3.0.0-beta.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install XboxAuthNet as a Cake Addin #addin nuget:?package=XboxAuthNet&version=3.0.0-beta.1&prerelease // Install XboxAuthNet as a Cake Tool #tool nuget:?package=XboxAuthNet&version=3.0.0-beta.1&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
XboxAuthNet
Xbox Live authentication
Ported from xboxlive-auth
Install
Nuget Package: XboxAuthNet
or download dlls from release
Sample program
Usage
Microsoft OAuth: Getting new tokens
MicrosoftOAuth oauth = new MicrosoftOAuth("CLIENT_ID", "SCOPE");
string url = oauth.CreateUrl(); // show url into webbrowser
// execute below codes when the url of webbrowser is changed (ex: NavigationStarting event)
// redirectUrl: new url of webbrowser
if (oauth.CheckLoginSuccess(redirectUrl))
{
MicrosoftOAuthResponse response;
if (oauth.TryGetTokens(out response)
{
// success to get MicrosoftOAuth token
// cache AccessToken, RefreshToken and ExpireIn to use next time
// response.AccessToken
// response.ExpireIn
// response.RefreshToken
// response.Scope
// response.TokenType
// response.UserId
}
else
{
// failed to login
}
}
Microsoft OAuth: Validating & Refreshing tokens
MicrosoftOAuth oauth = new MicrosoftOAuth("CLIENT_ID", "SCOPE");
MicrosoftOAuthResponse response = ~~~; // read from cache
if (oauth.TryGetTokens(out response, response.RefreshToken)
{
// success
// response.AccessToken
}
else
{
// failed to refresh tokens
}
XboxLive Login
XboxAuth xbox = new XboxAuth();
var rps = xbox.ExchangeRpsTicketForUserToken("Microsoft OAuth AccessToken");
var xsts = xbox.ExchangeTokensForXSTSIdentity(
rps.Token, // userToken
null, // deviceToken
null, // titleToken
"relyingParty", // relyingParty
null); // optionalDisplayClaims
if (xsts.IsSuccess)
{
// success
// xsts.Token: XSTS Token
// xsts.UserHash: UserHash (uhs)
// xsts.UserXUID
// xsts.IssueInstant
// xsts.ExpireOn
}
else
{
// fail
// xsts.Error
// xsts.Message
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net5.0-windows7.0 is compatible. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.7.2
- Microsoft.Web.WebView2 (>= 1.0.1210.39)
- Portable.BouncyCastle (>= 1.9.0)
- System.Net.Http.Json (>= 6.0.0)
- System.Text.Json (>= 6.0.0)
-
.NETStandard 2.0
- Portable.BouncyCastle (>= 1.9.0)
- System.Net.Http.Json (>= 6.0.0)
- System.Text.Json (>= 6.0.0)
-
net5.0-windows7.0
- Microsoft.Web.WebView2 (>= 1.0.1210.39)
- Portable.BouncyCastle (>= 1.9.0)
- System.Net.Http.Json (>= 6.0.0)
- System.Text.Json (>= 6.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on XboxAuthNet:
Package | Downloads |
---|---|
XboxAuthNet.Game
XboxAuthNet.Game |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.0.4 | 633 | 8/21/2024 |
3.0.3 | 124 | 8/20/2024 |
3.0.2 | 2,539 | 7/7/2023 |
3.0.1 | 170 | 7/7/2023 |
3.0.0 | 1,072 | 6/24/2023 |
3.0.0-beta.3 | 203 | 4/2/2023 |
3.0.0-beta.2 | 171 | 2/4/2023 |
3.0.0-beta.1 | 136 | 1/5/2023 |
2.2.0 | 3,078 | 9/7/2022 |
2.2.0-beta8 | 315 | 8/31/2022 |
2.1.0 | 1,573 | 7/29/2022 |
2.0.0 | 1,247 | 7/8/2022 |
2.0.0-beta1 | 166 | 5/29/2022 |
1.4.2 | 2,510 | 10/5/2021 |
1.4.1 | 664 | 8/22/2021 |
1.4.0 | 462 | 7/4/2021 |
1.3.0 | 504 | 12/28/2020 |
1.2.0 | 388 | 12/25/2020 |
1.1.0 | 423 | 12/14/2020 |
1.0.2 | 372 | 12/13/2020 |
1.0.1 | 467 | 12/13/2020 |
1.0.0 | 458 | 12/13/2020 |