Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Commit

Permalink
Fix the invalid exception messages mentioning OpenIddict
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchalet committed Oct 8, 2017
1 parent c734c6f commit cd83912
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit cd83912

Please sign in to comment.