Katana Webserver does not find clientSecret

I downloaded the katana project and wanted to try the client / server in the sandbox project.

I got into a problem for OAuthValidateClientAuthenticationContext:

public bool TryGetFormCredentials(out string clientId, out string clientSecret) { clientId = Parameters.Get(Constants.Parameters.ClientId); if (!String.IsNullOrEmpty(clientId)) { clientSecret = Parameters.Get(Constants.Parameters.ClientSecret); ClientId = clientId; return true; } clientId = null; clientSecret = null; return false; } 

clientSecret is null and therefore the following does not validate the client.

  private Task ValidateClientAuthentication(OAuthValidateClientAuthenticationContext context) { string clientId; string clientSecret; if (context.TryGetBasicCredentials(out clientId, out clientSecret) || context.TryGetFormCredentials(out clientId, out clientSecret)) { if (clientId == "123456" && clientSecret == "abcdef") { context.Validated(); } else if (context.ClientId == "7890ab" && clientSecret == "7890ab") { context.Validated(); } } return Task.FromResult(0); } 
+4
source share
1 answer

Make sure the client_secret parameter does not contain a space in your message

 client_secret[space] will fail. 
+5
source

Source: https://habr.com/ru/post/1502211/


All Articles