How to create a custom application using the Okta .NET SDK?

I’m trying to use the Applications.CreateApplicationAsync() method that takes an IApplication, instead of the pre-built arguments like CreateOpenIdConnectApplication. This is because CreateOpenIdConnectApplication doesn’t have a field for Profile.

I need to create an Application with custom values added to the Profile field.

The Application class (that implements IApplication) has the Profile field, and its type is Resource. Resource seems to be a very generic class that is used for nearly everything. I’m having trouble creating a class that implements IResource. There is the ResourceFactory class but that is in the Okta.Sdk.Internal namespace and I don’t think I want to be using that namespace.

I just want to add some string key/value pairs to the Profile field on an object that implements IApplication.

Any ideas?

@cat Hi, if you are talking about customized values to the application profile, you can try the below method.
Post the below API endpoint will add additional value to profile object.
As you can see in the picture, you can create a customized whitelist object under one specific application’s profile object.

You may try to verify this method in your postman.
If it works, then you can use the function PostAsync() to call the same endpoint in your code.

Hi @Lijia,

Thank you for the reply. That is what I am trying to do using the SDK instead of a PostAsync() call. I actually ended up posting this as an issue on GitHub and they provided a solution:

All good now, thanks!

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