# Okta .Net SDK and Microsoft.AspNetCore.Authentication.JwtBearer 8.0.\* Nuget Conflict

**URL:** <https://devforum.okta.com/t/okta-net-sdk-and-microsoft-aspnetcore-authentication-jwtbearer-8-0-nuget-conflict/29221>\
**Category:** API\
**Tags:** dotnet\
**Created:** [July 9, 2024, 2:12pm UTC](https://devforum.okta.com/t/okta-net-sdk-and-microsoft-aspnetcore-authentication-jwtbearer-8-0-nuget-conflict/29221 "2024-07-09T14:12:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![armandof](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@armandof](https://devforum.okta.com/u/armandof)\
**Post date:** [July 9, 2024, 2:12pm UTC](https://devforum.okta.com/t/okta-net-sdk-and-microsoft-aspnetcore-authentication-jwtbearer-8-0-nuget-conflict/29221/1 "2024-07-09T14:12:11Z")

</div>

Running into runtime error “IDX11025: Cannot serialize object of type: ‘System.Guid’ into property: ‘jti’’” when using Okta .Net SDK 8.0.1 along with Microsoft.AspNetCore.Authentication.JwtBearer 8.0.\*. The issue does not occur when using Microsoft.AspNetCore.Authentication.JwtBearer 7.0.20.  
The Okta Service App is setup to use scoped OAuth 2.0 access tokens with BPoP enabled - [Implement OAuth for Okta with a service app | Okta Developer].

Using sample .net code below:

var privateKey = new JsonWebKeyConfiguration  
{  
P = “{{P}}”,  
Kty = “RSA”,  
Q = “{{Q}}”,  
D = “{{D}}”,  
E = “{{E}}”,  
Kid = “{{Kid}}”,  
Qi = “{{Qi}}”,  
Dp = “{{Dp}}”,  
Dq = “{{Dq}}”,  
N = “{{N}}”  
};

var configuration = new Configuration  
{  
OktaDomain = “https://{{yourOktaDomain}}”,  
AuthorizationMode = AuthorizationMode.PrivateKey,  
ClientId = “{{clientId}}”,  
Scopes = new List { “okta.users.read”}, // Add all the scopes you need  
PrivateKey = privateKey  
};

var usersApiClient = new UserApi(configuration);  
var user = await \_usersApiClient.GetUserAsync(“{{userId}}”);

Stack Trace:  
at Okta.Sdk.Client.DefaultDpopProofJwtGenerator.GenerateJwt(String nonce, String httpMethod, String uri, String accessToken)  
at Okta.Sdk.Api.OAuthApi.d\_\_18.MoveNext()  
at Okta.Sdk.Api.OAuthApi.d\_\_17.MoveNext()  
at Okta.Sdk.Client.DefaultOAuthTokenProvider.d\_\_15.MoveNext()  
at Okta.Sdk.Client.DefaultOAuthTokenProvider.d\_\_7.MoveNext()  
at Okta.Sdk.Client.DefaultOAuthTokenProvider.d\_\_12.MoveNext()  
at Okta.Sdk.Api.UserApi.d\_\_43.MoveNext()  
at Okta.Sdk.Api.UserApi.d\_\_42.MoveNext()  
…

Other than downgrading to Microsoft.AspNetCore.Authentication.JwtBearer 7.0.20, any other solutions?

---

<div class="post-metadata">

**Author:** ![vk-giri](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/vk-giri/32/5178_2.png) [@vk-giri](https://devforum.okta.com/u/vk-giri)\
**Post date:** [July 11, 2024, 9:45am UTC](https://devforum.okta.com/t/okta-net-sdk-and-microsoft-aspnetcore-authentication-jwtbearer-8-0-nuget-conflict/29221/2 "2024-07-11T09:45:20Z")

</div>

Hi,

This github issue [JTI Claim as a string instead of guid by sachinsatav · Pull Request #682 · okta/okta-sdk-dotnet · GitHub](https://github.com/okta/okta-sdk-dotnet/pull/682) points to the same problem that you are facing, and the work in under process to have this changes into the version 8. You can keep a track here to check by when it will get resolved.

Until then it is suggested that you keep using the version 7.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [August 10, 2024, 9:46am UTC](https://devforum.okta.com/t/okta-net-sdk-and-microsoft-aspnetcore-authentication-jwtbearer-8-0-nuget-conflict/29221/3 "2024-08-10T09:46:10Z")

</div>

Closed on August 10, 2024, 9:46am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
