Permalink
Browse files

Fix the invalid exception messages mentioning OpenIddict

  • Loading branch information...
PinpointTownes committed Oct 8, 2017
1 parent c734c6f commit cd83912b47239ab7a47b6e8b4c312044890e9e84
@@ -87,8 +87,8 @@ public class OpenIdConnectServerMiddleware : AuthenticationMiddleware<OpenIdConn
if (Options.AccessTokenHandler != null && Options.SigningCredentials.Count == 0)
{
throw new ArgumentException("At least one signing key must be registered when using JWT as the access token format. " +
"Consider registering a X.509 certificate using 'services.AddOpenIddict().AddSigningCertificate()' " +
"or call 'services.AddOpenIddict().AddEphemeralSigningKey()' to use an ephemeral key.", nameof(options));
"Consider registering a X.509 certificate using 'options.SigningCredentials.AddCertificate()' " +
"or call 'options.SigningCredentials.AddEphemeralKey()' to use an ephemeral key.", nameof(options));
}
if (Options.DataProtectionProvider == null)
@@ -89,8 +89,8 @@ public class OpenIdConnectServerMiddleware : AuthenticationMiddleware<OpenIdConn
if (Options.AccessTokenHandler != null && Options.SigningCredentials.Count == 0)
{
throw new ArgumentException("At least one signing key must be registered when using JWT as the access token format. " +
"Consider registering a X.509 certificate using 'services.AddOpenIddict().AddSigningCertificate()' " +
"or call 'services.AddOpenIddict().AddEphemeralSigningKey()' to use an ephemeral key.", nameof(options));
"Consider registering a X.509 certificate using 'options.SigningCredentials.AddCertificate()' " +
"or call 'options.SigningCredentials.AddEphemeralKey()' to use an ephemeral key.", nameof(options));
}
if (Options.Logger == null)
@@ -127,8 +127,8 @@ public void Constructor_MissingSigningCredentialsThrowAnException()
Assert.Equal("options", exception.ParamName);
Assert.StartsWith("At least one signing key must be registered when using JWT as the access token format. " +
"Consider registering a X.509 certificate using 'services.AddOpenIddict().AddSigningCertificate()' " +
"or call 'services.AddOpenIddict().AddEphemeralSigningKey()' to use an ephemeral key.", exception.Message);
"Consider registering a X.509 certificate using 'options.SigningCredentials.AddCertificate()' " +
"or call 'options.SigningCredentials.AddEphemeralKey()' to use an ephemeral key.", exception.Message);
}
private static TestServer CreateAuthorizationServer(Action<OpenIdConnectServerOptions> configuration = null)
@@ -120,8 +120,8 @@ public void Constructor_MissingSigningCredentialsThrowAnException()
Assert.IsType<ArgumentException>(exception.InnerException);
Assert.Equal("options", ((ArgumentException) exception.InnerException).ParamName);
Assert.StartsWith("At least one signing key must be registered when using JWT as the access token format. " +
"Consider registering a X.509 certificate using 'services.AddOpenIddict().AddSigningCertificate()' " +
"or call 'services.AddOpenIddict().AddEphemeralSigningKey()' to use an ephemeral key.", exception.InnerException.Message);
"Consider registering a X.509 certificate using 'options.SigningCredentials.AddCertificate()' " +
"or call 'options.SigningCredentials.AddEphemeralKey()' to use an ephemeral key.", exception.InnerException.Message);
}
[Theory]

0 comments on commit cd83912

Please sign in to comment.