Advertisement
architekt909

Auth0ClientOptions.cs

Mar 10th, 2018
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.79 KB | None | 0 0
  1. using IdentityModel.OidcClient.Browser;
  2.  
  3. namespace Auth0.OidcClient
  4. {
  5.     public class Auth0ClientOptions
  6.     {
  7. #if __ANDROID__
  8.         /// <summary>
  9.         /// The Android Activity from which the login process is initiated.
  10.         /// </summary>
  11.         public Android.App.Activity Activity { get; set; }
  12. #endif
  13.  
  14.         /// <summary>
  15.         /// The <see cref="IBrowser"/> implementation which is responsible for displaying the Auth0 Login screen
  16.         /// </summary>
  17.         public IBrowser Browser { get; set; }
  18.  
  19.         /// <summary>
  20.         /// Your Auth0 Client ID.
  21.         /// </summary>
  22.         public string ClientId { get; set; }
  23.  
  24.         /// <summary>
  25.         /// Your Auth0 Client Secret.
  26.         /// </summary>
  27.         public string ClientSecret { get; set; }
  28.  
  29. #if __IOS__
  30.         /// <summary>
  31.         /// The View Controller from which the login process is initiated
  32.         /// </summary>
  33.         public UIKit.UIViewController Controller { get; set; }
  34.  
  35.         /*
  36.             Sets whether to use a WKWebView or an SFSafariViewController. The former allows for a better experience and is the default.
  37.             IMPORTANT: If this is enabled, you don't have to override OpenUrl in your AppDelegate like the quick start instructions say to.
  38.             That part of handling the redirect will be taken care of automatically.
  39.          */
  40.         //
  41.         public bool UseWKWebView { get; set; } = true;     
  42. #endif
  43.  
  44.         /// <summary>
  45.         /// Your Auth0 tenant domain.
  46.         /// </summary>
  47.         /// <remarks>
  48.         /// e.g. tenant.auth0.com
  49.         /// </remarks>
  50.         public string Domain { get; set; }
  51.  
  52.         /// <summary>
  53.         /// Indicates whether telemetry information should be sent to Auth0.
  54.         /// </summary>
  55.         /// <remarks>
  56.         /// Telemetry simply contains information about the version of the Auth0 OIDC Client being used. No information about your
  57.         /// application or users are being sent to Auth0.
  58.         /// </remarks>
  59.         public bool EnableTelemetry { get; set; }
  60.  
  61.         /// <summary>
  62.         /// Indicates whether the user profile should be loaded from the /userinfo endpoint.
  63.         /// </summary>
  64.         /// <remarks>
  65.         /// Defaults to true.
  66.         /// </remarks>
  67.         public bool LoadProfile { get; set; }
  68.  
  69.         /// <summary>
  70.         /// The scopes you want to request.
  71.         /// </summary>
  72.         public string Scope { get; set; }
  73.  
  74. #if WPF || WINFORMS || __ANDROID__
  75.         /// <summary>
  76.         /// Allow overriding of the Redirect URI
  77.         /// </summary>
  78.         /// <remarks>
  79.         /// This should only be done in exceptional circumstances
  80.         /// </remarks>
  81.         public string RedirectUri { get; set; }
  82. #endif
  83.  
  84.         public Auth0ClientOptions()
  85.         {
  86.             EnableTelemetry = true;
  87.             LoadProfile = true;
  88.             Scope = "openid profile";
  89.         }
  90.     }
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement