私は、ASP.Netコアアプリケーション用のUseOpenIdConnectAuthenticationミドルウェアを使用して、Dellのクラウドアクセスマネージャートークンプロバイダー(OpenId/OAuth2認証を提供するためのセットアップ)に対して認証しています。コードは次のとおりです。OpenIdConnectAuthenticationHandler:message.Stateがnullまたは空です
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AutomaticAuthenticate = true,
AutomaticChallenge = true,
AuthenticationScheme = "ClientCookie",
CookieName = CookieAuthenticationDefaults.CookiePrefix + "ClientCookie",
ExpireTimeSpan = TimeSpan.FromMinutes(5),
LoginPath = new PathString("/signin"),
LogoutPath = new PathString("/signout")
});
app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions
{
RequireHttpsMetadata = false,
SaveTokens = true,
ClientId = "XYZClient_Id",
ClientSecret = "XYZ_ClientSecret",
ResponseType = OpenIdConnectResponseType.Code,
PostLogoutRedirectUri = "https://example.com",
Configuration = new OpenIdConnectConfiguration {
AuthorizationEndpoint = "https://CAM.COM/CloudAccessManager/RPSTS/OAuth2/Default.aspx",
TokenEndpoint = "https://CAM.COM/CloudAccessManager/RPSTS/OAuth2/Token.aspx",
UserInfoEndpoint = "https://CAM.COM/CloudAccessManager/RPSTS/OAuth2/User.aspx",
Issuer= "urn:CAM.COM/CloudAccessManager/RPSTS",
}
});
しかし、今は数時間、1つのポイントで固まっています。次のエラーが表示されます。
SecurityTokenInvalidSignatureException:IDX10500:署名の検証に失敗しました。私は指導の任意のタイプは高く評価され https://example.com/signin-oidc?code=somecode&state=somestate
をクエリ文字列バックURL内のコードと状態を取得しています署名
を検証するために使用するためにはセキュリティキーがありません。
UPDATE 追加発行者の署名キー:
TokenValidationParameters = new TokenValidationParameters
{
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration.GetValue<string>("AppSettings:ClientSecret")))
}
これは多くの時間を節約し、プロバイダがコンフィグレーションディスカバリエンドポイントを提供しないため、署名キーを手動で追加することから始められます。また、即時返信のためにありがとう – CodeZero
答えが役に立つなら、それをupvote /受け入れられるとマークしてください;) – Pinpoint