Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Configurable Display type to Salesforce Auth Request #238

Merged
merged 2 commits into from
Nov 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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; }
Copy link
Owner

@TerribleDev TerribleDev Jun 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't This should default to page?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Display is an enum with Page as the default value - I can make it explicit if you would prefer?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No its fine thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to complete PR then?


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