Okta dotnet sdk innitialize

Hi I am trying to use the Okta sdk to manage users within my API.

I new up the client like below

var client = new OktaClient(new OktaClientConfiguration{
OktaDomain = “https://{mydomain}”,
Token = “my token”
});

I even tried with a clientId and setting the authMode.SSWS but get the following exeception.

System.MissingMethodException: Method not found: ‘System.Collections.Generic.IDictionary`2<YamlDotNet.RepresentationModel.YamlNode,YamlDotNet.RepresentationModel.YamlNode> YamlDotNet.RepresentationModel.YamlMappingNode.get_Children()’.
at FlexibleConfiguration.Providers.YamlVisitors.YamlVisitorBase.VisitChildren(YamlMappingNode mapping)
at FlexibleConfiguration.Providers.YamlVisitors.ContextAwareMappingVisitor.Visit(YamlMappingNode mapping)
at FlexibleConfiguration.Providers.YamlVisitors.YamlVisitorBase.YamlDotNet.RepresentationModel.IYamlVisitor.Visit(YamlMappingNode mapping)
at YamlDotNet.RepresentationModel.YamlMappingNode.Accept(IYamlVisitor visitor)
at FlexibleConfiguration.Providers.YamlVisitors.ContextAwareVisitor.Visit(YamlMappingNode mapping)
at FlexibleConfiguration.Providers.YamlVisitors.YamlVisitorBase.YamlDotNet.RepresentationModel.IYamlVisitor.Visit(YamlMappingNode mapping)
at YamlDotNet.RepresentationModel.YamlMappingNode.Accept(IYamlVisitor visitor)
at FlexibleConfiguration.Providers.YamlVisitors.YamlVisitorBase.VisitChildren(YamlDocument document)
at FlexibleConfiguration.Providers.YamlVisitors.YamlVisitorBase.Visit(YamlDocument document)
at FlexibleConfiguration.Providers.YamlVisitors.YamlVisitorBase.YamlDotNet.RepresentationModel.IYamlVisitor.Visit(YamlDocument document)
at YamlDotNet.RepresentationModel.YamlDocument.Accept(IYamlVisitor visitor)
at FlexibleConfiguration.Providers.YamlVisitors.YamlVisitorBase.VisitChildren(YamlStream stream)
at FlexibleConfiguration.Providers.YamlVisitors.YamlVisitorBase.Visit(YamlStream stream)
at FlexibleConfiguration.Providers.YamlVisitors.YamlVisitorBase.YamlDotNet.RepresentationModel.IYamlVisitor.Visit(YamlStream stream)
at YamlDotNet.RepresentationModel.YamlStream.Accept(IYamlVisitor visitor)
at FlexibleConfiguration.Providers.YamlParser.Parse(Stream input)
at FlexibleConfiguration.Providers.YamlProvider.Load()
at FlexibleConfiguration.ConfigurationBuilder.Add(IConfigurationProvider provider)
at FlexibleConfiguration.ConfigurationBuilderProviderExtensions.AddJson(IConfigurationBuilder builder, String json, String root, ILogger logger)
at FlexibleConfiguration.ConfigurationBuilderProviderExtensions.AddJsonFile(IConfigurationBuilder builder, String filePath, Boolean optional, String root, ILogger logger)
at Okta.Sdk.OktaClient.GetConfigurationOrDefault(OktaClientConfiguration apiClientConfiguration)
at Okta.Sdk.OktaClient…ctor(OktaClientConfiguration apiClientConfiguration, ILogger logger, ISerializer serializer)

Not sure what I am doing wrong and cant find a good tutorial on this.

@aashiq Hi, if you are using Okta dotnet sdk, you can post this code issues on GH.

@Lijia done here https://github.com/okta/okta-sdk-dotnet/issues/467 :slightly_smiling_face:

Found that YamlDotNet nuget package was being used in a total different resource to deserialize a request but was some how messing with a totally different REST resource I was using.

removed the package and depricated the unused endpoint. all working now

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