Is there any way that I can use my own info.plist instead of Okta plist

I want to define the sign in and sign out and client id’s for different environment like stage and release. But in the SSO sample there is only okta file and I was unable to define for prod environment. Is there any way that I can use my own plist.

Both the Swift Mobile and IDX SDKs allow you to load the configuration values in multiple ways. When you let the SDK do the configuration it uses the default Okta.plist file. You’ll need to do the configuration manually, either from your own plist file or by specifying the values directly.

There’s a full explanation in the SDK documentation in the WebAuthentication class of the WebAuthenticationUI library. The article title is “Configuring Your Client.” The same explanation works for the OAuth2Client class in the AuthFoundation library. (To see the documentation, open your project in Xcode and make sure that the Okta libraries are loaded as package dependences. Then choose Help > Developer Documentation and click on your app, then select the appropriate library and object.)

The configuration happens at initialization time. When you use the default initializer init(), it uses the Okta.plist file. To use your own plist file, call init(plist: URL) throws with the URL for the desired plist file. Other convenience initializers, such as init(issuer:clientId:scopes:redirectUri:logoutRedirectUri:additionalParameters:) let you specify all values without using a plist file.

Hopefully that helps.

2 Likes