Base solution for your next web application

Activities of "pankajmathur"

Answer

Thanks....

Answer

Hi,

As I said, the page becomes unresponsive. Once page becomes unresponsive that means pressing F5 does not send the request to the server. Since it does not send the request to the server, how can I get the error and thus stack trace.....

Regards, Mahendra

Answer

It's not that easy for me now. Again, please try to understand, I am not using IdentityServer. Still, after sometime the page goes unresposive...

Would it be possible for someone to come on a online session with me and check quickly what could be wrong.

Regards, Mahendra

Answer

Hi,

The ABP, we upgrade is simply upgrading the Nuget packages. Is there an easy way to upgrade the ASPNet Zero. Or the only way to upgrade ASPNet Zero is to download the latest version of ASPNet Zero and do a file merging. If this the way....do you think would it be an easy to upgrade?

Or, if there is an easy way to upgrade, please do let us know....

Regards, Mahendra

Answer

Can somebody please help. I am again putting my issue.

After ABP Upgrade to 3.7.2 from 3.6.2, my application page (any page) after some time (irrespective I am continuously working or left the page idle), becomes unresponsive. When I see the developer tool, it seems that once page becomes unresponsive, the F5 (Refresh), does not send any request to the server. If I delete the cookie, "AspNetCore.Identity.Application" and then press F5, it throws me to the login screen.....

Please help Regards, Mahendra

Answer

We are using JQuery Version. Also there is no definite time to be specific. And irrespective whether the page left idle for sometime or you continue working on the page. After some time it becomes unresponsive.

Also what I have noted is prior to upgrade, in the localhost if you are logged in once and then close the browser and reopen the localhost, it does not show you the login screen and you are straight away in to the application.

But after upgrade, each time I run localhost it asks for login.

Regards, Mahendra

Answer

Hi, If you read my issue carefully, even pressing F5 does not show any request sent in the Network tab of chrome developer tool. since, it is not sending request to server, there is nothing recorded in the log.

Answer

Hi,

Please ignore this post...It was my mistake.....solved now....

Hi,

I think, I have resolved it by using encodeURIComponent in the javascript client to encode the encrypted access token...

Anyway...thanks for your support....

Hi,

Let me try to explain you once again. My JavaScript client was successfully able to connect to My SignalR Hub and the data exchange between client and server was happening successfully till the time there is no authentication implemented.

Now to implement client authentication, I did the following:

In the CitiXsys.iVend365.Web.Mvc Project's AuthConfigurer.cs class, I add the following:

public static void Configure(IServiceCollection services, IConfiguration configuration)
        {
           .....
          if (bool.Parse(configuration["Authentication:JwtBearer:IsEnabled"]))
            {
              .......

                   options.Events = new JwtBearerEvents
                    {
                        OnMessageReceived = QueryStringTokenResolver
                    };
            }

        }


/* This method is needed to authorize SignalR javascript client.
         * SignalR can not send authorization header. So, we are getting it from query string as an encrypted text. */
        private static Task QueryStringTokenResolver(MessageReceivedContext context)
        {
            if (!context.HttpContext.Request.Path.HasValue ||
                !context.HttpContext.Request.Path.Value.StartsWith("/signalr"))
            {
                //We are just looking for signalr clients
                return Task.CompletedTask;
            }

            var qsAuthToken = context.HttpContext.Request.Query["enc_auth_token"].FirstOrDefault();
            if (qsAuthToken == null)
            {
                //Cookie value does not matches to querystring value
                return Task.CompletedTask;
            }

            //Set auth token from cookie
            try
            {
                context.Token = SimpleStringCipher.Instance.Decrypt(qsAuthToken, AppConsts.DefaultPassPhrase);
            }
            catch (Exception ex)
            {

            }
            return Task.CompletedTask;
        }

Also In My Hub Class, I added the attribute AbpAuthorize.

[AbpAuthorize]
    public class iVend365Hub : AbpCommonHub
    {
        
        public iVend365Hub(IOnlineClientManager onlineClientManager, IClientInfoProvider clientInfoProvider) : base(onlineClientManager, clientInfoProvider)
        {
        }

        public override Task OnConnectedAsync()
        {
            return base.OnConnectedAsync();
        }

        public override Task OnDisconnectedAsync(Exception exception)
        {
            ConnectedClient DisConnectedClient =  AppStatic.ConnectedClients.Where(p => p.ConnectionId == Context.ConnectionId).SingleOrDefault();
            AppStatic.ConnectedClients.Remove(DisConnectedClient);
            Clients.All.SendAsync("PrintConnectedPOS", "POS - " + DisConnectedClient.POSKey + " DisConnected");
            return base.OnDisconnectedAsync(exception);
        }

        
        public void RegisterPOS(Int32 TenantId, string POSKey)
        {
            
            ConnectedClient connectedClient = new ConnectedClient() { TenantId = TenantId, POSKey = POSKey, ConnectionId = Context.ConnectionId };
            AppStatic.ConnectedClients.Add(connectedClient);
            Clients.All.SendAsync("PrintConnectedPOS", "POS - " + POSKey + " Connected");
        }
    }

Now From Postman, I called the API <a class="postlink" href="http://localhost:62114//api/TokenAuth/Authenticate">http://localhost:62114//api/TokenAuth/Authenticate</a> and get the accesstoken and encryptedAccessToken.

Now from my client I am trying the connect to SignalR Hub by passing encryptedAccessToken as query string as below:

const connection = new signalR.HubConnectionBuilder()
            .withUrl("http://localhost:62114/signalr?enc_auth_token=wNYmO41/48SHNstaLVXxHCCre29BZQl1NhC6NM3R3rzpXtPQxVzH6jEzA/QhXFN5tu6Fk7pO53uppm1mVXMZgxbyRVz26dnepi/FyB6axBY+6gq1GL+uRQgoiFUCjRN2p8w6LevViwKlHyWZZJZO1DGVSjAi1m2U+og9pkHw9/QZzDt3yiLMoYW1WDdaXPnlFLgt0N06nDVJ/TNUnhw0BCL43otzv+OMKuLeY+h0rGYDeO90t9A/K6VhhzUXsg1AnxPiqcPpiycwoLyZAZ53/kzTppy8m3SYqaKUsjOESlkAY8kF2r7y154j9qEUcLk9utfC3PSRp0oSuNrm4VSVguDREewfyWbN2sKRaHtlXs5UxIgBWyA348/T9keWz4iRdlPaw7R66Toe+whj4AhIwXhBIQMqxokrK1Sq2LBTHHwJPAUsTkzsTwP1v0/VcSC9oGwxy27ovrSXKN9G5/i43T5nZW5vR+X2Q4SVFS4wi03ifhySoobT6PgEUGaET9Xp62cBKgzEM589+abpKPMhAs4533XlfdfWRr6UxNUUF0LMuya3RB2NCE1h6ccRo0vujM9DMiKxU04lQ5ezjQV6k1lqFx0CjsCZEscMH91ICvjAuAnUXkHpCeNyfJl5Om+Xen1Ef57GeI0WV/5Rj6h6FJt+z8xDXCZJ8ikvpQe+tjjvX+vAfQdyR5nFgHC/vCNiab0x/qnWgJyoQOcXxMUZ43HXsRIruWCre/gpHvfEysGKsk7V3PLpdgESTQVNniZPHs7EypH8r8+T9VRiR1X964QUmqnaBMn3pNkrMBm1gEqyB1sP7HNlz3dLvjRRUX3JcD2/Pe5elhZBjnYRLu8Ay7pJaEzXgEeJ3cRGkq8DbxXZEg5O+f3+VjYssQDjesGGg8ZDwaBDriBSWjOtvnw7OFqvD7qk4xzXqFZpIRnqkJ/70mLCFfTGTxpjMWnFMTu9xh8Snm2/uPex48biHG30f4BXw0xmW2xZ521GIRdgFIE=")
            .configureLogging(signalR.LogLevel.Information)
            .build();
        connection.start().catch(err => console.error(err.toString()));

But it throws the error in the following code:

context.Token = SimpleStringCipher.Instance.Decrypt(qsAuthToken, AppConsts.DefaultPassPhrase);

The error returned is: Invalid length for a Base-64 char array or string.

Please help...

Showing 1 to 10 of 79 entries