principalement du format de code

This commit is contained in:
Paul Schneider 2020-09-12 01:11:30 +01:00
commit ff1444d664
87 changed files with 510 additions and 550 deletions

View file

@ -15,7 +15,7 @@ namespace Yavsc.Auth
{
internal class GoogleHandler : OAuthHandler<YavscGoogleOptions>
{
private ILogger _logger;
private readonly ILogger _logger;
public GoogleHandler(HttpClient httpClient,ILogger logger)
: base(httpClient)
{
@ -92,9 +92,11 @@ namespace Yavsc.Auth
{
var scope = FormatScope();
var queryStrings = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
queryStrings.Add("response_type", "code");
queryStrings.Add("client_id", Options.ClientId);
var queryStrings = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{
{ "response_type", "code" },
{ "client_id", Options.ClientId }
};
// this runtime may not known this value,
// it should be get from config,
// And always be using a secure sheme ... since Google won't support anymore insecure ones.

View file

@ -16,8 +16,8 @@ namespace Yavsc.Auth
/// </summary>
public class GoogleMiddleware : OAuthMiddleware<YavscGoogleOptions>
{
private RequestDelegate _next;
private ILogger _logger;
private readonly RequestDelegate _next;
private readonly ILogger _logger;
/// <summary>
/// Initializes a new <see cref="GoogleMiddleware"/>.

View file

@ -15,8 +15,9 @@ namespace Yavsc.Auth {
_googleUserId = googleUserId;
Principal = ticket.Principal;
}
AuthenticationTicket _ticket;
string _googleUserId;
readonly AuthenticationTicket _ticket;
readonly string _googleUserId;
public AuthenticationTicket Ticket { get { return _ticket; } }
@ -24,4 +25,4 @@ namespace Yavsc.Auth {
}
}
}