Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: app ignores authority in auth.config and use default authWellKnownEndPoints #2041

Open
jatingandhi28 opened this issue Nov 5, 2024 · 1 comment

Comments

@jatingandhi28
Copy link

Version

15,18

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

I defined config as below - 
import { NgModule } from '@angular/core';
import { AuthModule } from 'angular-auth-oidc-client';


@NgModule({
  imports: [AuthModule.forRoot({
    config: {
      authority: 'https://login.microsoftonline.com/https://login.microsoftonline.com/<tenantid>/v2.0/v2.0',
      authWellknownEndpointUrl: 'https://login.microsoftonline.com/common/v2.0',
      redirectUrl: window.location.origin,
      clientId: '<clientid>',
      scope: 'user_impersonation openid profile offline_access',
      responseType: 'code',
      silentRenew: true,
      useRefreshToken: true,
      maxIdTokenIatOffsetAllowedInSeconds: 600,
      issValidationOff: false,
      autoUserInfo: false
    }
  })],
  exports: [AuthModule],
})
export class AuthConfigModule { }

Azure Ad is configured for single tenant but while using above config app calls common endpoint of azure ad.
While debugging found it uses default authWellKnownEndpoints from library.

Steps to reproduce the behavior

Create a new angular app with 15 or 18 version and use pkce flow with azure ad.

A clear and concise description of what you expected to happen.

It should use authroity url provided in config or there should be explanation of how to configure single tenant and multi tenant application for azure ad authentication.

Additional context

No response

@jatingandhi28
Copy link
Author

solved above issue by supplying authWellknownEndpointUrl along with authority. authority is mandatory but it doesn't use authority while fetching config and authWellknownEndpointUrl is not mandatory but uses it instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant