Skip to content

Latest commit

 

History

History
61 lines (44 loc) · 3.9 KB

File metadata and controls

61 lines (44 loc) · 3.9 KB

Frequently Asked Questions

  1. Does Trimble Identity .NET MAUI support PKCE?
  2. How is persistent storage implemented in the SDK?
  3. Can we provide two seperate redirect uri to sdk to handle redirect in Android and iOS apps?
  4. How to fix Compiler Error CS1705.
    Error CS1705: Assembly 'Trimble.Id' with identity 'Trimble.Id, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.iOS, Version=16.4.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' which has a higher version than referenced assembly 'Microsoft.iOS' with identity 'Microsoft.iOS, Version=16.2.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' (CS1705)
  5. What does OnReceive() do?
  6. How to use WithActivity() or WithViewController() and why?

Yes Trimble Identity .NET MAUI supports PKCE.

Persistent storage is implemented using Secure Storage in the sdk. For more details refer Secure Storage.

Yes, you can specify different redirect uri for Android, iOS and Windows.

var options = new MobileAuthenticatorOptions
  {
    EndpointProvider = "<ENDPOINT_PROVIDER>",
    ClientId = "<CLIENT_ID>",
    Scopes = new[] { "<SCOPES>" },
#if ANDROID
    RedirectUri = "<ANDROID_REDIRECT_URI>", 
#elif IOS
    RedirectUri = "<IOS_REDIRECT_URI>", 
#elif WINDOWS
    RedirectUri = "<WINDOWS_REDIRECT_URI>",  
#endif
    EnableTokenPersistence = true
  };

Error CS1705: Assembly 'Trimble.Id' with identity 'Trimble.Id, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.iOS, Version=16.4.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' which has a higher version than referenced assembly 'Microsoft.iOS' with identity 'Microsoft.iOS, Version=16.2.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' (CS1705)

This error is caused by the accidental use of two versions of the same assembly. Ensure that the latest dotnet workloads are installed in your app. To resolve this, please try updating the iOS MAUI workloads on your machine using the command dotnet workload install or dotnet workload update. Please check the dotnet workload for more information.

OnReceieve() is invoked to complete the authentication flow. OnReceive() basically exchanges the authcode for tokens and completes Login. On Logout (singleSignOut must be set to true), OnReceive() clears the browser session. For more details on usage of OnReceive() refer README.

WithActivity() and WithViewController() is needed to launch the browser. Once the MobileAuthenticator instance is created, these methods need to be invoked in platform specific ways before invoking any other sdk methods like Login, Logout etc. Activity/ViewController from which the browser needs to launched/closed needs to be passed as a parameter.

#if IOS
        _mobileAuthenticator = mobileAuthenticator.WithViewController(Platform.GetCurrentUIViewController());

#elif ANDROID
        _mobileAuthenticator = mobileAuthenticator.WithActivity(Platform.CurrentActivity);