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

Session lost when My App > External Page > My App #3968


User avatar
0
ajayak created

I logged into my app. Then the page is redirected to external application(Shopify) which makes request to API in my app service. In my function, I save a FullAuditedEntity but the CreatorUserId and TenantId is null in that case.


6 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    @ajayak, if third party app is not making a redirect to your app, then it must send some information about your account, maybe a token.

    Can you explain how third party app calls your function ?

  • User Avatar
    0
    ajayak created

    I have created a Shopify app. When user clicks a button on my page, then I'm redirecting the user to Shopify app page. On that page, there is an Install button. User clicks on install and Shopify install the app. After installing, Shopfiy calls a url in my app and I don't have any control over request parameters

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ajayak,

    I don't have any knowledge about shopify but if shopify is redirecting user back to your website, session must be kept. Can you debug this ? If so, can you check values of AbpSession when shopify redirects user back to your site ?

    Thanks.

  • User Avatar
    0
    ajayak created

    Hi @ismcagdas,

    On my angular app, I am redirecting the user external url as

    window.location.href = externalUrl;
    

    On the external page, there is a button to accept the agreement, which calls my app back. On debug, I found that ApbSession.UserId is null along with most of the properties in AbpSession. If I use [AbpAuthorize] on top of method, I get Authentication error when redirecting to my app.

  • User Avatar
    0
    ajayak created

    Also, after redirection to my app, the Abp cookies and headers are still present in Request.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ajayak,

    Can you share your angular2 app's url, it's host url and the url you make redirect from third part app ?

    I think you need to redirect back to your angular app's url from third party app and then you need to make an ajax request to host app according to some query string parameter that third part app sends when redirecting back to your website.