okta / okta-oidc-xamarin

Okta OIDC SDK for Xamarin
https://github.com/okta/okta-oidc-xamarin
Apache License 2.0
10 stars 11 forks source link

Why is OktaConfig a platform-specific class? #14

Closed davidaramantSEP closed 4 years ago

davidaramantSEP commented 4 years ago

I understand that there are platform-specific methods to load the config in various native ways, but the actual configuration appears to be completely cross platform. It seems like the loading methods could be split off to some other class. For a Xamarin Forms project, if OktaConfig was cross-platform the configuration could be done in code in one location.

bryanapellanes-okta commented 4 years ago

I understand that there are platform-specific methods to load the config in various native ways, but the actual configuration appears to be completely cross platform. It seems like the loading methods could be split off to some other class. For a Xamarin Forms project, if OktaConfig was cross-platform the configuration could be done in code in one location.

@davidaramantSEP, Thanks for your inquiry! This library is still in very early development and your suggestions and comments are always welcome.

The OktaConfig class is defined as a partial. Functionality that is cross platform can be defined in the common library project here: https://github.com/okta/okta-oidc-xamarin/blob/master/Okta.Xamarin/Okta.Xamarin/OktaConfig.cs

Platform specific functionality can be defined in the platform specific partials defined for iOS here: https://github.com/okta/okta-oidc-xamarin/blob/master/Okta.Xamarin/Okta.Xamarin.iOS/OktaConfig.iOS.cs

and for Android here: https://github.com/okta/okta-oidc-xamarin/blob/master/Okta.Xamarin/Okta.Xamarin.Android/OktaConfig.Android.cs

Having a common method to call regardless of platform that delegates to the platform specific implementation would be ideal, we'll consider this for future inclusion in the library.

Hopefully, this answers your question, let me know if I've misinterpreted. Feel free to submit a pull request if you have a proposed implementation that solves your needs and potentially the needs of others; we will review for inclusion in a future release of the library.