TokenClient Error following .Net 4.x Tutorial

I have a legacy .Net 4.5.1 Web Form App that I’m trying to build Okta into. I followed the directions in the following blog exactly: https://developer.okta.com/blog/2018/08/29/secure-webforms-with-openidconnect-okta

I’m getting several errors in the Startup.cs class. They all are around creating the TokenClient class. It wants only two parameters, but the example gives three. I have a feeling this Startup.cs class is from MVC and causing this error? I’m not sure. Here is the code:

var tokenClient = new TokenClient($"{_authority}/v1/token", _clientId, _clientSecret);

Error => ‘TokenClient’ does not contain a constructor that takes 3 arguments

The signature it calls for is TokenClient(HttpMessageInvoker, TokenClientOptions)

Can anyone help?

Hi @dicer2000

Can you please open a support case with us through an email to developers@okta.com in order to further investigate this issue?

I also get the same error by following the same blog, so I would like to know the solution as well.

I too am experiencing the same problem. Not sure what is wrong. Any response yet?

just encountered the same problem, did you find what the issue with it was?

Fixed this error by replacing IdentityModel 4.x with IdentityModel 3.9.0

2 Likes

I was able to resolve the error by doing this, also changing to version 3.10.10 worked too. I’m curious if Okta Devs have any other suggestions though. I’d prefer running a more current version of IdentityModel if possible instead of going back 2 whole versions

Can you please help me. My issue is not solved for the above query

Any idea what is the latest version for this to get solved?

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