Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "kalidarscope"

No.

   <input id="createdate" type="text"  name="creatioN_TIME" class="form-control" ui-date-format="mm/dd/yyyy" bsDatepicker [(ngModel)]="organization.creatioN_TIME" autocomplete="off">
      <input id="Expirydate" type="text" name="expirY_DATE" class="form-control" bsDatepicker [(ngModel)]="organization.expirY_DATE" ui-date-format="mm/dd/yyyy" autocomplete="off">

In ts file to retrive data,

 this.CreateDate = new Date(moment(result.creatioN_TIME, 'YYYY-MM-DDTHH:mm:ss').format());
 this.ExpiryDate = new Date(moment(result.expirY_DATE, 'YYYY-MM-DDTHH:mm:ss').format());
import { PermissionCheckerService } from '@abp/auth/permission-checker.service';
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, CanLoad, Router, RouterStateSnapshot } from '@angular/router';
import { AppSessionService } from '@shared/common/session/app-session.service';
import { UrlHelper } from '@shared/helpers/UrlHelper';
import { Data, Route } from '@node_modules/@angular/router/src/config';
import { Observable } from '@node_modules/rxjs/internal/Observable';
import * as _ from 'lodash';

@Injectable()
export class AppRouteGuard implements CanActivate, CanActivateChild, CanLoad {

    constructor(
        private _permissionChecker: PermissionCheckerService,
        private _router: Router,
        private _sessionService: AppSessionService
    ) { }

    canActivateInternal(data: Data, state: RouterStateSnapshot): boolean {
        debugger;

        if (_.includes(state.url, 'asap-sso')) {
            this._router.navigate(['app/main/asap-sso', 66]);
            return true;
        }

        if (UrlHelper.isInstallUrl(location.href)) {
            return true;
        }

        if (!this._sessionService.user) {
            this._router.navigate(['/account/login']);
            return false;
        }

        if (!data || !data['permission']) {
            return true;
        }

        if (this._permissionChecker.isGranted(data['permission'])) {
            return true;
        }

        this._router.navigate([this.selectBestRoute()]);
        return false;
    }

    canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
        return this.canActivateInternal(route.data, state);
    }

    canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
        return this.canActivate(route, state);
    }

    canLoad(route: Route): Observable<boolean> | Promise<boolean> | boolean {
        return this.canActivateInternal(route.data, null);
    }

    selectBestRoute(): string {
        debugger;
        if (!this._sessionService.user) {
            return '/account/login';
        }

        if (this._permissionChecker.isGranted('Pages.Administration.Host.Dashboard')) {
            //return '/app/admin/hostDashboard';            
            return '/app/admin/users';            
        }

        if (this._permissionChecker.isGranted('Pages.Tenant.Dashboard')) {
            return '/app/main/dashboard';
        }

        if (this._permissionChecker.isGranted('Pages.Tenants')) {
            return '/app/admin/tenants';
        }

        if (this._permissionChecker.isGranted('Pages.Administration.Users')) {
            return '/app/admin/users';
        }

        return '/app/notifications';        
    }
}

I have used below code but it was not working.

if (_.includes(state.url, 'asap-sso')) {
            this._router.navigate(['app/main/asap-sso', 66]);
            return true;
        }

ASP.NET CORE and Angular

I have to access the url without login, but it is redirected to login page. I wolud like to stop the redirection to login the page for my scenario. Could you please assist me

Could you please the share the link to follow? I have tried to pass the encrypted value in url but it is redirect to login page. Is it possible to process the url we call, without redirect to login?

Added the new claim, it has my session value. But we get the injected value in session.

Is it possible to create a token from another application and login into the application with that token ? If possible, how can i create a token.

We have the CPQ application and ASP.NET Zero application. We have to login from CPQ to ASP.NET zero application without password authentication.

Notes: In our CPQ application we have the option to login into CPQ with password authentication. They are maintaining some keys in their portal, we can use that to encrypt the username from our application. After we encrpt we could pass the username, domain and encrypted value in url. It will not ask any authentication to login. It will login into CPQ application without password authentication.

Same way it could possible to login into ASP.NET zero application without password authentication. Is it possible?

Showing 51 to 60 of 121 entries