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

Activities of "aaron"

Let's take a look at references first.

Your VS 2017 version is v15.1; update to v15.3.3+.

Can you show what's in Clarity.BabcockCRM.Web.csproj?

Answer

Hi @ramezani583,

You need to use VS 2017 v15.3.3+ for building AspNet Zero.

Answer

Here is an example that sends a parameter to a stored procedure to delete a user:

public async Task DeleteUser(EntityDto input)
{
   await Context.Database.ExecuteSqlCommandAsync(
       "EXEC DeleteUserById @id",
       default(CancellationToken),
       new SqlParameter("id", input.Id)
   );
}

Using Stored Procedure, User Defined Function and Views in a Custom Repository with ASP.NET Boilerplate: https://www.codeproject.com/Articles/1199648/Using-Stored-Procedure-User-Defined-Function-and-V

Source code is published on Github: https://github.com/aspnetboilerplate/aspnetboilerplate-samples/tree/master/StoredProcedureDemo

SlidingExpiration is only available for cookies: https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-configuration?tabs=aspnetcore2x#applications-cookie-settings

In general, sliding expiration for accessToken is wrong - once accessToken is leaked, it can be used to indefinitely prolong the access. That's what a refresh token is for. ASP.NET Zero does not handle refresh tokens but you can refer to IdentityServer4's Token Endpoint. Note that refresh token also has to be handled client-side: when you receive 401 Error, call the endpoint, then set to new accessToken.

If you decide to do sliding expiration, here's a third-party document on Reissusing a JWT with a New (Sliding) Expiration for WebApi.

Can you show the full stack trace?

You only need to include accessToken in Authorization header:

See: https://aspnetboilerplate.com/Pages/Documents/Zero/Startup-Template-Angular#use-api

It's actually used for login integration to the main application - not comprehensively documented but has a brief section here: https://www.aspnetzero.com/Documents/Development-Guide-Core#single-sign-on

You may be able to adapt it for your requirements.

Showing 1471 to 1480 of 1543 entries