Skip to content

Commit

Permalink
Merge pull request #238 from sprice88/master
Browse files Browse the repository at this point in the history
Adding Configurable Display type to Salesforce Auth Request
  • Loading branch information
TerribleDev committed Nov 4, 2018
2 parents 17ae5ef + b64e7e5 commit 6850514
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ public class SalesforceAuthenticationEndpoints
public string Environment { get; set; }
}

/// <summary>
/// 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
/// </summary>
public enum Display{
page,
popup,
touch,
mobile
}

/// <summary>
/// Gets or sets the a pinned certificate validator to use to validate the endpoints used
/// in back channel communications belong to Salesforce.
Expand Down Expand Up @@ -110,6 +125,10 @@ public string Caption
/// <see cref="System.Security.Claims.ClaimsIdentity" />.
/// </summary>
public string SignInAsAuthenticationType { get; set; }
/// <summary>
/// Gets or sets the display—(Optional)
/// </summary>
public Display DisplayMode { get; set; }

/// <summary>
/// Gets or sets the type used to secure data handled by the middleware.
Expand Down

0 comments on commit 6850514

Please sign in to comment.