Starts in:
0 DAY
0 HR
47 MIN
43 SEC
Starts in:
0 D
0 H
47 M
43 S

Activities of "muhammedaltug"

Hello,

You can remove items with UserMenuService

import { UserMenuService } from '@abp/ng.theme.shared';
import { Component } from '@angular/core';
import { eUserMenuItems } from '@volosoft/abp.ng.theme.lepton-x';

@Component({
  selector: 'app-root',
  template: 'component template'
})
export class AppComponent {
  constructor(userMenu: UserMenuService) {
    userMenu.removeItem(eUserMenuItems.LinkedAccounts);
    userMenu.removeItem(eUserMenuItems.MyAccount);
    userMenu.removeItem(eUserMenuItems.SecurityLogs);
    userMenu.removeItem('Gdpr.GdprNavigation');
  }
}

Hello,

Where we supposed to do this exactly?

We call url https://localhost:44374/connect/logout?post_logout_redirect_uri=https://support.abp.io/&client_id=Angular_App&id_token_hint=access_token

Before making the request to the logout endpoint. You need to change the post_logout_redirect_uri param(Don't forget to encode url).

When we logout abp commercial angular we need to logout RP (Relying party) too.

You need to make a request to the RP logout endpoint.

But what about post logout redirect when we logout abp commercial angular?

You can pass the RP url as redirect uri to angular logout url(http://localhost:4200/logout?post_redirect_url=encoded_rp_url)

You can do it by following the steps below.

I added the following URLs to Administration>OpenId>Applications>MyApllication->Edit>Post Logout Redirect Uris http://localhost:4200/logout http://localhost:4200/logout?post_logout_redirect_uri=https%3A%2F%2Flocalhost%3A44365 https://localhost:44365

Listening logout event for calling the other client's logout URL.

import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { OAuthService } from 'angular-oauth2-oidc';
import { filter } from 'rxjs';

@Component({
  selector: 'app-root',
  template: `
    <abp-loader-bar></abp-loader-bar>
    <abp-dynamic-layout></abp-dynamic-layout>
    <abp-gdpr-cookie-consent></abp-gdpr-cookie-consent>
  `,
})
export class AppComponent {
  constructor(oAuthService: OAuthService) {
     oAuthService.events.pipe(filter(e => e.type === 'logout')).subscribe(() => { 
      const currentUrl = router.url.split('?')[0];
      //check logout location
      if (currentUrl !== '/logout') {
        // logout from rp
        window.open('otherclientloguturl', '_blank');
      }
    });
  }
}

Pass redirect uri to auth server for redirect RP again

@Component({
  selector: '',
  template: '',
})
class LogoutComponent {
  constructor(authService: OAuthService, route: ActivatedRoute) {
    route.queryParams.subscribe(params => {
      const { post_logout_redirect_uri } = params;
      authService.revokeTokenAndLogout({ post_logout_redirect_uri });
    });
  }
}

Hello

We fixed it. The fix will be available in the next version.

Hello,

You can edit the template on ABP Suite. Click templates on the navbar and edit Frontend.Angular.__name@kebab__-routing.module.ts.template to edit the routing module. For your case, you can replace it with the content below

import { AuthGuard, PermissionGuard, RouterOutletComponent, ReplaceableComponents } from '@abp/ng.core';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { <%= name %>Component } from './components/<%= kebab(name) %>.component';

const routes: Routes = [
{
    path: '',
    component: RouterOutletComponent,
    canActivate: [AuthGuard, PermissionGuard],
    children: [
      {
        path: '',
        component: <%= name %>Component,
        data: {
          replaceableComponent: {
            key: '<%= name %>ComponentKey',
            defaultComponent: <%= name %>Component,
          } as ReplaceableComponents.RouteData,
        },
      },
    ],
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class <%= name %>RoutingModule {}

Hello,

If you want, you can implement revocation and logout with the revocation endpoint.

If you want to log out with redirection, please follow the steps below.

Create a component named LogoutComponent and add to declarations array of app.module.ts

import { Component } from '@angular/core';
import { OAuthService } from 'angular-oauth2-oidc';
@Component({
  selector: '',
  template: '',
})
class LogoutComponent {
  constructor(authService: OAuthService) {
    authService.revokeTokenAndLogout();
  }
}

Add 'logout' route to app.routing.ts

import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { LogoutComponent } from './logout.component'
const routes: Routes = [
    //other routes
  {
    path: 'logout',
    component: LogoutComponent,
  },
];

@NgModule({
  imports: [RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' })],
  exports: [RouterModule],
})
export class AppRoutingModule {}

Change post_logout_redirect_uri http://localhost:4200 to http://localhost:4200/logout

Hello

generate-proxy.json file has two api-defition responses. The second response starts from line 1381. If you don't want to generate from scratch, you can modify the file so as to include only one response and generate proxies with the existing generate-proxy.json with commands below

ng g @abp/ng.schematics:api --module=app --apiName=Default --source=__default --target=__default 
ng g @abp/ng.schematics:proxy-index --target=__default 

Hello

The reason for this error difference between the entity name and the name of the database table. Did you change the entity name AppBranches to Branche? By the way, we created an internal issue about this situation.

Can you try the angular side by running the command below in angular/.suite/schematics/ folder?

node run-schematics.mjs "D:/TechPlus/Pln/Code/Tp.Tam/angular/.suite/schematics/node_modules/.bin/ng" g ".suite/schematics/collection.json:entity" app-pro Tp.Tam "D:/TechPlus/Pln/Code/Tp.Tam/aspnet-core/.suite/entities/AppBranches.json" "D:/TechPlus/Pln/Code/Tp.Tam/angular" 

Hello,

Also, you need to update angular/.suite/schematics/package.json

Hello

The error is [File Not Found] There is no file at "D:/TechPlus/Pln/Code/Tp.Tam/aspnet-core/.suite/entities/Branche.json" path.

Can you check was file created? Can you check the file and parent folders have read permission?

Hello,

The generate-proxy.json file is an invalid JSON file. Please try after removing your proxy folder and regenerating it with abp generate-proxy -t ng command.

Showing 51 to 60 of 254 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06