Open Closed

Angular: External Authentication Provider flow is added in ABP IO (Angular and MongoDB template ) or not? like Microsoft,Google,Facebook login implemented in ASPNETZERO? #343


User avatar
0
suraj.kumbhar created

ABP Framework version: v3.0.5 UI type: Angular Db: MongoDb

We tried Microsoft login (AAD) in Razor Pages UI & Entity Framework Core for Microsoft login and its working fine. We would like to know whether Social login is provided/implemented in Angular-MondoDb template or not because tried it but not able to find it in Angular project. Or Please provide us link/video so we can have a look into it.


4 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Does it work for you?

    https://stackoverflow.com/questions/55303781/asp-net-core-and-angular-microsoft-authentication

  • User Avatar
    0
    suraj.kumbhar created

    NO, but We tried using the above way and many different ways also, One thing we want to know that we are retireving access token using IdentityServer4 like this angular using OAuthService

    return from(this.oAuthService.loadDiscoveryDocument()).pipe(
          switchMap((data) =>
            from(
              this.oAuthService.fetchTokenUsingPasswordFlow(
                username,
                password,
                new HttpHeaders({ ...(tenant && tenant.id && { __tenant: tenant.id }) }),
              ).then((token)=>{
                
              }
              ),
            ),
          ),
          switchMap((data) => this.store.dispatch(new GetAppConfiguration())),
          tap((data) => {
            const redirectUrl =
              snq(() => window.history.state.redirectUrl) || (this.options || {}).redirectUrl || '/';
            this.store.dispatch(new Navigate([redirectUrl]));
          }),
          take(1),
        );
    

    Here we get an access token and get access to all backend apis. Can we know how we will be get generate that access token if login using AAD through Oauth Implicit flow? because we are able to login using AAD in angular, generating accesstoken and claims as well but further process is not clear to us.

    const tenant = this.store.selectSnapshot(SessionState.getTenant);
        this.oAuthService.tokenValidationHandler = new JwksValidationHandler();
        this.oAuthService.configure(
          this.store.selectSnapshot(ConfigState.getOne('environment')).aadConfig,
        );    
        this.oAuthService.initImplicitFlow('providername=AzureOpenId');
    

    After successful AAD login its redirecting to home controller where we can get accesstoken and claims.

    this.oAuthService.tryLogin().then(() => {
          let claims = this.oAuthService.getIdentityClaims(); 
          }
    

    But as we know its not authentiing the user from database , its just a successfull microsoft login but not abp login as user is not part of the system.

    Please help us in next process!

  • User Avatar
    0
    Mehmet created

    Hi @suraj.kumbhar

    We developed the Angular UI to support Code Flow (PKCE). The Code Flow will be default authentication flow in the v3.1. In this flow, you will redirect to the Identity Server authentication page and be able to use all features of the Identity Server. If you can integrate the Azure AD to Razor Pages UI, you will be used the AD properly.

  • User Avatar
    0
    alper created
    Support Team Director

    closing due to inactivity...

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11