Skip to content

v1.0.0-beta1

Choose a tag to compare

@niemyjski niemyjski released this 24 Apr 03:18
· 3 commits to master since this release
8ae36ed

This is the first beta release of the upcoming OAuth2 1.0 line.

This release significantly modernizes the library, updates provider integrations, improves diagnostics, adds nullable reference type annotations, updates the build and test infrastructure, and introduces transport-level request options for configuring HTTP behavior.

We are marking this release as beta because the 1.0 API shape is now considered close to stable, but we want real-world validation from existing users before publishing the final stable v1.0.0 release.

Please upgrade, test your OAuth provider flows, and report any provider-specific issues before the stable release.

⚠️ This is a beta release and contains breaking changes. Please validate your OAuth login and callback flows before deploying to production.

Recommended upgrade path

<PackageReference Include="OAuth2" Version="1.0.0-beta1" />

Highlights

  • Added multi-targeting for modern .NET:
    • netstandard2.0
    • net8.0
    • net10.0
  • Upgraded RestSharp to 114.0.0.
  • Replaced Newtonsoft.Json with System.Text.Json.
  • Enabled nullable reference types across the library.
  • Added RequestOptions for configurable HTTP timeout and future transport settings.
  • Added MicrosoftClient for Microsoft Identity Platform v2.0 and Microsoft Graph v1.0.
  • Updated and verified provider endpoints across supported providers.
  • Added OAuth error code and error description support to UnexpectedResponseException.
  • Removed dead providers whose APIs are no longer available.
  • Added provider compatibility documentation and provider audit notes.
  • Added CodeQL security analysis.
  • Added NuGet package README support.
  • Expanded and modernized tests.

New: RequestOptions

This release adds a new transport-level RequestOptions type.

RequestOptions currently supports configuring HTTP timeout behavior without adding transport concerns to the OAuth client configuration interfaces.

var options = new RequestOptions
{
    Timeout = TimeSpan.FromSeconds(10)
};

var client = new GoogleClient(factory, configuration, options);

When RequestOptions is omitted or null, behavior remains unchanged and RestSharp defaults are used.

This API intentionally uses BCL types such as TimeSpan? so it is not tied to RestSharp. That gives the library a clean path for future transport improvements without requiring application-level code to change.

Transport note

This release still uses RestSharp internally.

The new RequestOptions abstraction is intentionally transport-agnostic so settings such as timeout can survive a future internal migration away from RestSharp if that should ever happen. If that migration can be done safely without consumer-facing API changes, it may happen before or after v1.0.0 if enough community feedback wants us to go that direction.

Any consumer-facing breaking transport or extensibility changes after v1.0.0 will be reserved for a future major release.

Breaking changes

RestSharp upgraded to 114.0.0

RestSharp was upgraded from the legacy 106.x line to 114.0.0.

This may affect consumers that interact with RestSharp types directly, customize request creation, implement custom request factories, or extend OAuth2 internals.

Newtonsoft.Json removed

OAuth2 no longer depends on Newtonsoft.Json.

Internal JSON parsing now uses System.Text.Json.

This may affect consumers that subclass clients and depend on Newtonsoft-specific behavior in overridden parsing methods.

Nullable reference types enabled

Nullable reference types are now enabled across the library.

Public API surfaces have been annotated to better represent provider data that may be absent or optional.

This may introduce new compiler warnings in consuming projects with nullable reference types enabled. These warnings are intentional and should help identify cases where provider data may be missing.

Examples of newly nullable members include:

  • UserInfo and AvatarInfo string properties
  • Optional configuration fields such as scope and public client values
  • OAuth token and state values
  • Provider-specific user/profile fields
  • Error response fields
  • JSON parsing helper return values

Removed providers

The following clients were removed because their backing APIs are no longer available in their previous form:

  • InstagramClient
  • XingClient

TwitterClient renamed to XClient

TwitterClient has been replaced by XClient to reflect the provider rename from Twitter to X.

The old TwitterClient name remains as an obsolete compatibility wrapper.

Provider behavior changes

Several providers were updated to current endpoints, schemas, or authorization behavior.

Provider updates include:

  • GitHub now uses Bearer authorization instead of the deprecated token authorization scheme.
  • Google was updated to v2/v3 endpoints and now uses the sub field from the v3 schema.
  • Facebook is pinned to Graph API v25.0.
  • LinkedIn was updated to v2 OpenID Connect.
  • Todoist was updated to REST API v1.
  • VK API version was updated.
  • Uber authentication endpoints were updated.
  • X user info now includes email where available.
  • Microsoft Identity Platform support was added through the new MicrosoftClient.

New features

Microsoft Identity Platform support

Added MicrosoftClient using Microsoft Identity Platform v2.0 and Microsoft Graph v1.0.

This is the preferred path for new Microsoft integrations.

MicrosoftClient is not intended to be a drop-in replacement for every WindowsLiveClient usage.

Configurable HTTP timeout

Added transport-level request options for configuring timeout behavior.

var options = new RequestOptions
{
    Timeout = TimeSpan.FromSeconds(30)
};

This resolves the long-standing need to configure HTTP request timeout behavior without changing OAuth identity configuration.

Improved OAuth error diagnostics

UnexpectedResponseException now captures OAuth callback error details when providers return error and error_description.

For example, when a user denies authorization, consumers can now inspect the actual OAuth error code such as access_denied and the provider-supplied description.

The exception message now includes these details for easier debugging.

Provider updates

This release includes a broad provider audit and modernization pass.

Added

  • MicrosoftClient

Removed

  • InstagramClient
  • XingClient

Renamed

  • TwitterClient -> XClient

Updated

  • GitHubClient
  • GoogleClient
  • FacebookClient
  • LinkedInClient
  • TodoistClient
  • UberClient
  • VkClient
  • XClient

Documented provider status

The README now includes a provider compatibility matrix with provider status, API version, authorization endpoint, and verification notes.

A new provider audit document captures active, legacy, deprecated, rebranded, and removed provider status.

Security and reliability improvements

  • Upgraded several provider endpoints from HTTP to HTTPS.
  • Added CodeQL workflow for C# security analysis.
  • Improved null handling in provider user-info parsing.
  • Fixed Asana parsing when users have no profile photo.
  • Fixed Odnoklassniki request signing behavior.
  • Added additional argument validation in request factory paths.
  • Added more defensive JSON parsing.
  • Improved OAuth callback error reporting.
  • Added more provider serialization and parsing coverage.
  • Added missing state and avatar test assertions.

JSON serialization changes

OAuth2 now uses System.Text.Json internally.

Changes include:

  • Converted JSON-using providers from Newtonsoft.Json to JsonDocument / JsonElement.
  • Converted token response parsing to System.Text.Json.
  • Added helper methods for safer string extraction and case-insensitive property access.
  • Added guards for null, missing, and unexpected JSON values.
  • Added provider-specific serialization and parsing tests.
  • Added coverage for numeric IDs, avatar URLs, boolean values, null values, and provider edge cases.

Build and dependency updates

  • Converted solution to .slnx.
  • Updated target frameworks:
    • Library: netstandard2.0, net8.0, net10.0
    • Tests: modern .NET test targets
  • Upgraded RestSharp to 114.0.0.
  • Removed Newtonsoft.Json.
  • Upgraded MinVer.
  • Upgraded NUnit.
  • Upgraded NUnit3TestAdapter.
  • Upgraded FluentAssertions.
  • Upgraded Microsoft.NET.Test.Sdk.
  • Upgraded NSubstitute.
  • Upgraded AsyncFixer.
  • Upgraded Microsoft.SourceLink.GitHub.
  • Updated GitHub Actions:
    • actions/checkout
    • actions/setup-dotnet
  • Added NuGet package README support.
  • Fixed build warnings and warning-as-error issues.

Testing

This release includes a substantial test modernization pass.

Test improvements include:

  • Provider-specific JSON serialization coverage.
  • Provider parsing regression tests.
  • Request factory timeout tests.
  • Null handling tests.
  • OAuth error response tests.
  • Asana null photo regression test.
  • Additional WindowsLive avatar and state assertions.
  • Additional numeric ID conversion tests.
  • Test naming and structure cleanup.

Migration guide

1. Update your package reference

<PackageReference Include="OAuth2" Version="1.0.0-beta1" />

2. Rebuild and review nullable warnings

If your project has nullable reference types enabled, review any new warnings from OAuth2 API usage.

Many provider fields are now correctly annotated as nullable because external OAuth provider data may be missing.

3. Replace removed providers

If you use InstagramClient or XingClient, those clients have been removed because the underlying APIs are no longer available in their previous form.

4. Prefer XClient over TwitterClient

Replace new usages of:

var client = new TwitterClient(...);

with:

var client = new XClient(...);

TwitterClient remains as an obsolete compatibility wrapper.

5. Review custom subclasses

If you subclass OAuth clients or override JSON parsing behavior, review those implementations carefully.

Parsing now uses System.Text.Json instead of Newtonsoft.Json.

6. Review custom request factory implementations

If you implement IRequestFactory, update your implementation for the new RequestOptions overload.

7. Validate RestSharp-specific integrations

If your application interacts directly with RestSharp types through OAuth2 extensibility points, validate behavior with RestSharp 114.0.0.

8. Validate provider login flows

Test your full login and callback flow for each provider you use, especially:

  • GitHub
  • Google
  • Facebook
  • LinkedIn
  • Todoist
  • Uber
  • VK
  • X
  • Microsoft

Known beta considerations

This release modernizes a large amount of infrastructure and provider code.

Although test coverage has been expanded substantially, OAuth providers can differ in behavior across tenants, scopes, environments, and account types. Please validate the providers you use in your own staging environment before production rollout.

Please report provider-specific issues so they can be addressed before the stable v1.0.0 release.

Suggested version path

1.0.0-beta1    Current modernization release; upgrade and test
1.0.0-beta2    Provider, docs, or migration fixes from feedback
1.0.0-rc1      API frozen; final validation
1.0.0          Stable
2.0.0          Only if future consumer-facing transport/API changes require it

Full changelog

Compare: v0.10.3...v1.0.0-beta1