代码之家  ›  专栏  ›  技术社区  ›  rashidnk

当在角度中启用哈希位置时,Okta重定向Url不工作

  •  2
  • rashidnk  · 技术社区  · 8 年前

    在我的Angular6应用程序中,我将oktaConfig对象配置为如下所示,这样可以正常工作,没有任何问题

    //okataConfig.ts
    
            export const oktaConfig = {
              url: 'https://dev-501039.oktapreview.com',
              clientId: 'xxxxxxxxxxxxxxxxxxxxxx',
              issuer: 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
              redirectUri: 'http://localhost:4200/implicit/callback',
            };
    
            //routing.ts
    
              {path: '',component: DefaultLayoutComponent,canActivate: [AuthGuard]},
              {path: 'implicit/callback',component: CallbackComponent},
    

    但当我启用散列位置时,重定向不起作用,

    //应用模块.ts

    providers: [
        {
          provide: LocationStrategy,
          useClass: HashLocationStrategy,
        },
        AuthGuard, OktaAuthService
      ],
    

    在路由中应如何配置?

    0 回复  |  直到 8 年前
    推荐文章