diff --git a/src/Owin.Security.Providers.Salesforce/SalesforceAuthenticationHandler.cs b/src/Owin.Security.Providers.Salesforce/SalesforceAuthenticationHandler.cs index 9ab62fff..b0d4a200 100644 --- a/src/Owin.Security.Providers.Salesforce/SalesforceAuthenticationHandler.cs +++ b/src/Owin.Security.Providers.Salesforce/SalesforceAuthenticationHandler.cs @@ -195,7 +195,7 @@ protected override Task ApplyResponseChallengeAsync() var authorizationEndpoint = ComposeAuthorizationEndpoint(properties); authorizationEndpoint = - $"{authorizationEndpoint}?response_type={"code"}&client_id={Options.ClientId}&redirect_uri={HttpUtility.UrlEncode(redirectUri)}&display={"page"}&immediate={false}&state={Uri.EscapeDataString(state)}"; + $"{authorizationEndpoint}?response_type={"code"}&client_id={Options.ClientId}&redirect_uri={HttpUtility.UrlEncode(redirectUri)}&display={Options.DisplayMode}&immediate={false}&state={Uri.EscapeDataString(state)}"; if (Options.Scope != null && Options.Scope.Count > 0) { diff --git a/src/Owin.Security.Providers.Salesforce/SalesforceAuthenticationOptions.cs b/src/Owin.Security.Providers.Salesforce/SalesforceAuthenticationOptions.cs index 97a71ced..65d03e89 100644 --- a/src/Owin.Security.Providers.Salesforce/SalesforceAuthenticationOptions.cs +++ b/src/Owin.Security.Providers.Salesforce/SalesforceAuthenticationOptions.cs @@ -26,6 +26,21 @@ public class SalesforceAuthenticationEndpoints public string Environment { get; set; } } + /// + /// Options for Display Mode + /// Changes the login and authorization pages’ display type. Salesforce supports these values. + /// page—Full-page authorization screen(default) + /// popup—Compact dialog optimized for modern web browser popup windows + /// touch—Mobile-optimized dialog designed for modern smartphones, such as Android and iPhone + /// mobile—Mobile-optimized dialog designed for less capable smartphones, such as BlackBerry OS 5 + /// + public enum Display{ + page, + popup, + touch, + mobile + } + /// /// Gets or sets the a pinned certificate validator to use to validate the endpoints used /// in back channel communications belong to Salesforce. @@ -110,6 +125,10 @@ public string Caption /// . /// public string SignInAsAuthenticationType { get; set; } + /// + /// Gets or sets the display—(Optional) + /// + public Display DisplayMode { get; set; } /// /// Gets or sets the type used to secure data handled by the middleware.