#41 Update the google prompt command
This commit is contained in:
Родитель
cedccb11e4
Коммит
0ef0401a0b
|
@ -195,7 +195,9 @@ namespace Microsoft.Owin.Security.Google
|
|||
|
||||
AddQueryString(queryStrings, properties, "access_type", Options.AccessType);
|
||||
AddQueryString(queryStrings, properties, "approval_prompt");
|
||||
AddQueryString(queryStrings, properties, "prompt");
|
||||
AddQueryString(queryStrings, properties, "login_hint");
|
||||
AddQueryString(queryStrings, properties, "include_granted_scopes");
|
||||
|
||||
string state = Options.StateDataFormat.Protect(properties);
|
||||
queryStrings.Add("state", state);
|
||||
|
|
|
@ -214,7 +214,10 @@ namespace Katana.Sandbox.WebServer
|
|||
{
|
||||
map.Run(context =>
|
||||
{
|
||||
context.Authentication.Challenge(new AuthenticationProperties() { RedirectUri = "/" }, context.Request.Query["scheme"]);
|
||||
var properties = new AuthenticationProperties();
|
||||
properties.RedirectUri = "/"; // Go back to the home page after authenticating.
|
||||
properties.Dictionary["prompt"] = "select_account"; // Google
|
||||
context.Authentication.Challenge(properties, context.Request.Query["scheme"]);
|
||||
return Task.FromResult(0);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -47,7 +47,9 @@ namespace Microsoft.Owin.Security.Tests.Google
|
|||
|
||||
location.ShouldNotContain("access_type=");
|
||||
location.ShouldNotContain("approval_prompt=");
|
||||
location.ShouldNotContain("prompt=");
|
||||
location.ShouldNotContain("login_hint=");
|
||||
location.ShouldNotContain("include_granted_scopes=");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -162,7 +164,9 @@ namespace Microsoft.Owin.Security.Tests.Google
|
|||
{ "scope", "https://www.googleapis.com/auth/plus.login" },
|
||||
{ "access_type", "offline" },
|
||||
{ "approval_prompt", "force" },
|
||||
{ "login_hint", "test@example.com" }
|
||||
{ "prompt", "consent" },
|
||||
{ "login_hint", "test@example.com" },
|
||||
{ "include_granted_scopes", "true" }
|
||||
}), "Google");
|
||||
res.StatusCode = 401;
|
||||
}
|
||||
|
@ -175,7 +179,9 @@ namespace Microsoft.Owin.Security.Tests.Google
|
|||
query.ShouldContain("scope=" + Uri.EscapeDataString("https://www.googleapis.com/auth/plus.login"));
|
||||
query.ShouldContain("access_type=offline");
|
||||
query.ShouldContain("approval_prompt=force");
|
||||
query.ShouldContain("prompt=consent");
|
||||
query.ShouldContain("login_hint=" + Uri.EscapeDataString("test@example.com"));
|
||||
query.ShouldContain("include_granted_scopes=true");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
Загрузка…
Ссылка в новой задаче