【问题标题】:Validation of config rejected with errors. Config is NOT set配置验证因错误而被拒绝。配置未设置
【发布时间】:2023-01-10 00:02:03
【问题描述】:

大约一年前,我开始从事这个项目。 突然出现如下错误

这是一个角度/身份服务器/Web Api 实现。 由于某些奇怪的原因,身份服务器似乎没有收到验证客户端应用程序所需的配置信息。 就在应用程序启动时,它抱怨“必须在配置中提供权限 URL!配置验证因错误而被拒绝。未设置配置”

下面是我的 app.module 中的代码,应该在其中设置配置

export const httpLoaderFactory = (httpClient: HttpClient) => {
  const config$ = httpClient.get<any>(`${window.location.origin}/api/ClientAppSettings`)
    .pipe(
      map((customConfig: any) => {
        return {
          stsServer: customConfig.stsServer,
          redirectUrl: customConfig.redirect_url,
          clientId: customConfig.client_id,
          responseType: customConfig.response_type,
          scope: customConfig.scope,
          postLogoutRedirectUri: customConfig.post_logout_redirect_uri,
          startCheckSession: customConfig.start_checksession,
          silentRenew: customConfig.silent_renew,
          silentRenewUrl: customConfig.redirect_url + '/silent-renew.html',
          postLoginRoute: customConfig.startup_route,
          forbiddenRoute: customConfig.forbidden_route,
          unauthorizedRoute: customConfig.unauthorized_route,
          logLevel: 0, // LogLevel.logLevel or customConfig.logLevel
          maxIdTokenIatOffsetAllowedInSeconds: customConfig.max_id_token_iat_offset_allowed_in_seconds,
          historyCleanupOff: true,
          // autoUserInfo: false,
        };
      })
    )
  //.toPromise();

  return new StsConfigHttpLoader(config$);
};

【问题讨论】:

    标签: angular authentication asp.net-identity


    【解决方案1】:

    I know this is old now but I came across it as the ONLY serach result I found so hope this helps someone else.

    看来您使用的是 angular-auth-oidc-client,并且没有按照正确的迁移路径从较低版本(V11 和更早版本)更新到 V12。

    例如,V11 使用 stsServer: 因为它是 authority URL(如您的示例所示),但 V12 将其更改为 authority:。

    对于每个版本更改,请按照官方Angular Auth OIDC Client Docs site 上的迁移说明进行操作。那是针对 V11-V12 的,但该页面上还有所有其他内容。

    【讨论】:

      猜你喜欢
      • 2014-07-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-20
      • 1970-01-01
      • 2016-07-23
      • 2018-12-11
      相关资源
      最近更新 更多