GithubHelp home page GithubHelp logo

erl.aspnetcore.authentication.clientcertificate's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

erl.aspnetcore.authentication.clientcertificate's Issues

Accepts invalid characters for certificate description

The description field accepts characters that cause an unhandled exception when generating a certificate.

Error: "The string contains an invalid X500 name, attribute key, OID, value or delimiter"
--
To avoid this error, create a new certificate and verify that there are no special characters inany of the fields in the distinguished name. In particular, do not include a comma in the company name.The following characters are not allowed in any of the CSR fields:[! @ # $ % ^ * ( ) ~ ? > < & / \ , . " ']

Input

{
  "Description":"very loooooooooooong description for this certificate, how does it look",
  "Role":"ClientCertificateManager",
  "Password":"123",
  "ValidForMonths":12
}

Return from server

Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: The string contains an invalid X500 name attribute key, oid, value or delimiter.
   at Internal.Cryptography.Pal.X509Pal.X500DistinguishedNameEncode(String distinguishedName, X500DistinguishedNameFlags flag)
   at System.Security.Cryptography.X509Certificates.X500DistinguishedName.Encode(String distinguishedName, X500DistinguishedNameFlags flags)
   at System.Security.Cryptography.X509Certificates.X500DistinguishedName..ctor(String distinguishedName, X500DistinguishedNameFlags flag)
   at System.Security.Cryptography.X509Certificates.CertificateRequest..ctor(String subjectName, ECDsa key, HashAlgorithmName hashAlgorithm)
   at erl.AspNetCore.Authentication.ClientCertificate.DefaultCertificateGenerator.GenerateCertificate(String subjectName, String friendlyName, DateTime notBefore, DateTime notAfter) in C:\Users\peder\Documents\Projects\CertificateAuthentication\erl.AspNetCore.Authentication.ClientCertificate\DefaultCertificateGenerator.cs:line 16
   at erl.AspNetCore.Authentication.ClientCertificate.ClientCertificateController.<>c__DisplayClass9_0.<Generate>b__0() in C:\Users\peder\Documents\Projects\CertificateAuthentication\erl.AspNetCore.Authentication.ClientCertificate\ClientCertificateController.cs:line 264
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
   at erl.AspNetCore.Authentication.ClientCertificate.ClientCertificateController.Generate(GenerateCertificateModel model) in C:\Users\peder\Documents\Projects\CertificateAuthentication\erl.AspNetCore.Authentication.ClientCertificate\ClientCertificateController.cs:line 263
   at lambda_method(Closure , Object )
   at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.