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

Activities of "dreamsmiths"

Good day,

How can I override / overload the abp.ng.http.showError method in my angular project?

After reading couple of post, I have tried the following without success:

  1. added "../node_modules/abp-web-resources/Abp/Framework/scripts/libs/angularjs/abp.ng.js" to the .angular-cli.json file

  2. Created a js file with the following code:

var abp = abp || {};

(function () {

    abp.ng.http.showError = function (error) {
        alert("am in!!");
       
    }
})();
  1. Added js file to the .angular-cli.json file.

For testing, I have added an alert in the showError method of "\node_modules\abp-ng2-module\src\abpHttp.ts" and alert was showing for all error messages. Should this method be overwritten instead of the one in the js file? .

showError(error: IErrorInfo): any {
		alert("am in");
        if (error.details) {
            return this._messageService.error(error.details, error.message || this.defaultError.message);
        } else {
            return this._messageService.error(error.message || this.defaultError.message);
        }
    }

Good day,

Is there a way in boilerplate to extend the AbpAuthorize attribute ?

I want to achieve the following:

When an authorized application service function is called , I want to execute some logic without adding a custom attribute to each authorized application service.

Thanks in advance.

Hi

We are looking to implement single sign in into our application. If the API and Angular App is hosted on different domains, would the Single Sign In still work out of the box?

[HttpPost]
        public async Task<AuthenticateResultModel> Authenticate([FromBody] AuthenticateModel model)
        {
          ....
            if (model.SingleSignIn.HasValue && model.SingleSignIn.Value && loginResult.Result == AbpLoginResultType.Success)
            {
                loginResult.User.SetSignInToken();
                returnUrl = AddSingleSignInParametersToReturnUrl(model.ReturnUrl, loginResult.User.SignInToken, loginResult.User.Id, loginResult.User.TenantId);
            }
...
}

Regards Dreamsmiths

Good day,

Is there a way in the boilerplate to implement a custom filter for service functions similar to an "action filter in MVC" ?

I want to achieve the following:

When the service API function is called ( /api/services/app/someService/Get) I want to check a cached value and depending on the value I want to continue with the API call or throw an exception to the user.

Thanks in advance.

We are using the AspNetZero template to create a portal. The only difficult part I cant figure out, is to allow the user to authenticate through an external API, instead of the SQL database. Can you please perhaps give guidance on what is the best way to allow the user to enter their credentials, uses aspnetzero identity server, but then authenticates the username and password through an external API? (The external API call accept a username and password, and return a bool if credentials is correct)

If you do have an example somewhere on how to tackle this, it would be amazing.

We would still want to save information about the user in our AspNetZero database, like permissions etc after the user has logged in as per normal. (but the users password shouldn’t be stored here)

We are using angular, .netcore2, and identity server to allow single sign on ability. Thanks

Showing 1 to 5 of 5 entries