當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript angular-auth-oidc-client.AuthWellKnownEndpoints類代碼示例

本文整理匯總了TypeScript中angular-auth-oidc-client.AuthWellKnownEndpoints的典型用法代碼示例。如果您正苦於以下問題:TypeScript AuthWellKnownEndpoints類的具體用法?TypeScript AuthWellKnownEndpoints怎麽用?TypeScript AuthWellKnownEndpoints使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了AuthWellKnownEndpoints類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: OpenIDImplicitFlowConfiguration

    this.oidcConfigService.onConfigurationLoaded.subscribe(() => {
      const openIDImplicitFlowConfiguration = new OpenIDImplicitFlowConfiguration();

      openIDImplicitFlowConfiguration.stsServer = environment.stsServer;
      // openIDImplicitFlowConfiguration.redirect_url = document.baseURI;
      openIDImplicitFlowConfiguration.redirect_url = document.baseURI;
      // openIDImplicitFlowConfiguration.redirect_url = document.baseURI + 'assets/silent_login.html';
      // The Client MUST validate that the aud (audience) Claim contains its client_id value registered at the Issuer
      // identified by the iss (issuer) Claim as an audience.
      // The ID Token MUST be rejected if the ID Token does not list the Client as a valid audience,
      // or if it contains additional audiences not trusted by the Client.
      openIDImplicitFlowConfiguration.client_id = environment.clientId;
      openIDImplicitFlowConfiguration.response_type = 'id_token token';
      openIDImplicitFlowConfiguration.scope = 'openid profile email offline_access ala roles';
      openIDImplicitFlowConfiguration.post_logout_redirect_uri = document.baseURI;
      openIDImplicitFlowConfiguration.start_checksession = false; // CAS doesn't support this
      openIDImplicitFlowConfiguration.silent_renew = true;
      openIDImplicitFlowConfiguration.silent_renew_offset_in_seconds = 3600;
      openIDImplicitFlowConfiguration.silent_renew_url = document.baseURI + 'assets/silent_renew.html';
      openIDImplicitFlowConfiguration.silent_redirect_url = document.baseURI + 'assets/silent_renew.html';
      // openIDImplicitFlowConfiguration.storage = window.localStorage;
      // openIDImplicitFlowConfiguration.post_login_route = '/';
      // HTTP 403
      openIDImplicitFlowConfiguration.forbidden_route = '/403';
      // HTTP 401
      openIDImplicitFlowConfiguration.unauthorized_route = '/401';
      openIDImplicitFlowConfiguration.log_console_warning_active = true; // false
      openIDImplicitFlowConfiguration.log_console_debug_active = true; // false
      // id_token C8: The iat Claim can be used to reject tokens that were issued too far away from the current time,
      // limiting the amount of time that nonces need to be stored to prevent attacks.The acceptable range is Client specific.
      openIDImplicitFlowConfiguration.max_id_token_iat_offset_allowed_in_seconds = 3600; // 3
      openIDImplicitFlowConfiguration.auto_userinfo = true;
      openIDImplicitFlowConfiguration.auto_clean_state_after_authentication = true;
      // openIDImplicitFlowConfiguration.trigger_authorization_result_event = true;
      openIDImplicitFlowConfiguration.post_login_route = '/';
      // openIDImplicitFlowConfiguration.resource = '';
      // openIDImplicitFlowConfiguration.silent_renew = true;
      // openIDImplicitFlowConfiguration.trigger_authorization_result_event = false;

      const authWellKnownEndpoints = new AuthWellKnownEndpoints();
      authWellKnownEndpoints.setWellKnownEndpoints(this.oidcConfigService.wellKnownEndpoints);

      window.addEventListener("sc-login-message", (evt: CustomEvent) => {
        console.log("sc-login-message", evt.detail);
        this.oidcSecurityService.authorizedCallback(evt.detail)
      });
      this.oidcSecurityService.setupModule(
        openIDImplicitFlowConfiguration,
        authWellKnownEndpoints
      );

    });
開發者ID:AtlasOfLivingAustralia,項目名稱:seasonal-calendar,代碼行數:52,代碼來源:app.module.ts

示例2: OpenIDImplicitFlowConfiguration

     this.oidcConfigService.onConfigurationLoaded.subscribe(() => {
      const openIDImplicitFlowConfiguration = new OpenIDImplicitFlowConfiguration();
      openIDImplicitFlowConfiguration.stsServer = this.oidcConfigService.clientConfiguration.stsServer;
      openIDImplicitFlowConfiguration.redirect_url = this.oidcConfigService.clientConfiguration.redirect_url;
      // The Client MUST validate that the aud (audience) Claim contains its client_id value registered at the Issuer
      // identified by the iss (issuer) Claim as an audience.
      // The ID Token MUST be rejected if the ID Token does not list the Client as a valid audience,
      // or if it contains additional audiences not trusted by the Client.
      openIDImplicitFlowConfiguration.client_id = this.oidcConfigService.clientConfiguration.client_id;
      openIDImplicitFlowConfiguration.response_type = this.oidcConfigService.clientConfiguration.response_type;
      openIDImplicitFlowConfiguration.scope = this.oidcConfigService.clientConfiguration.scope;
      openIDImplicitFlowConfiguration.post_logout_redirect_uri = this.oidcConfigService.clientConfiguration.post_logout_redirect_uri;
      openIDImplicitFlowConfiguration.start_checksession = this.oidcConfigService.clientConfiguration.start_checksession;
      openIDImplicitFlowConfiguration.silent_renew = this.oidcConfigService.clientConfiguration.silent_renew;
      openIDImplicitFlowConfiguration.silent_renew_url = this.oidcConfigService.clientConfiguration.silent_renew_url;
      openIDImplicitFlowConfiguration.post_login_route = this.oidcConfigService.clientConfiguration.startup_route;
      // HTTP 403
      openIDImplicitFlowConfiguration.forbidden_route = this.oidcConfigService.clientConfiguration.forbidden_route;
      // HTTP 401
      openIDImplicitFlowConfiguration.unauthorized_route = this.oidcConfigService.clientConfiguration.unauthorized_route;
      openIDImplicitFlowConfiguration.log_console_warning_active = this.oidcConfigService.clientConfiguration.log_console_warning_active;
      openIDImplicitFlowConfiguration.log_console_debug_active = this.oidcConfigService.clientConfiguration.log_console_debug_active;
      // id_token C8: The iat Claim can be used to reject tokens that were issued too far away from the current time,
      // limiting the amount of time that nonces need to be stored to prevent attacks.The acceptable range is Client specific.
      openIDImplicitFlowConfiguration.max_id_token_iat_offset_allowed_in_seconds = this.oidcConfigService.clientConfiguration.max_id_token_iat_offset_allowed_in_seconds;

      const authWellKnownEndpoints = new AuthWellKnownEndpoints();
      authWellKnownEndpoints.setWellKnownEndpoints(
        this.oidcConfigService.wellKnownEndpoints
      );

      this.oidcSecurityService.setupModule(
        openIDImplicitFlowConfiguration,
        authWellKnownEndpoints
      );

      
    });
開發者ID:ArmyMusicOnline,項目名稱:ami,代碼行數:38,代碼來源:app.module.ts


注:本文中的angular-auth-oidc-client.AuthWellKnownEndpoints類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。