Starts in:
2 DAYS
21 HRS
55 MIN
56 SEC
Starts in:
2 D
21 H
55 M
56 S
Open Closed

Tenant-Id and Tenant-Name Not Set in Header After Dashboard Redirect (SSO OIDC) #8132


User avatar
0
Repunjay_TASC created
  • ABP Framework version: 8.0
  • UI Type: Angular
  • Database System: EF Core (PostgreSQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

We have a requirement where, when a client clicks on our application logo (which is already configured within their application), they should be redirected directly to the IdP's login page instead of the ABP.IO login page. After authentication with the IdP, the user should be redirected to our dashboard.

Using below ABP.IO support ticket i am successfully able to run POC project. Note :- Tenant not set in POC project.

https://abp.io/support/questions/7788/Custom-Redirection-to-third-party-IdP-Login-Page-and-Dashboard-Post-Authentication-in-ABPIO?CurrentPage=2

Error :- After integrating the same code into our existing project, we successfully authenticated with the IDP, added the user to the database, and were redirected to the dashboard. However, after a few seconds, the application automatically redirects to the logout page I have cross check log it's look like tenant not set that's why user not able to login.

For your refence please find below log

We need to set the tenant name and tenant ID headers for the dashboard redirect URL. How can we do this ?


110 Answer(s)
  • User Avatar
    0
    Repunjay_TASC created

    pls check shared information over email.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    https://product.dev.xxxxx.net/assets/js/loadding.js

    The url still does not return js but html page.

    Is there anything special about your server?

  • User Avatar
    0
    Repunjay_TASC created

    URL not working for you ?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    yes, same as https://abp.io/qa/questions/8050/3a157db0-f2c7-3f04-5269-cf463596b0ab

  • User Avatar
    0
    Repunjay_TASC created

    yes, same as https://abp.io/qa/questions/8050/3a157db0-f2c7-3f04-5269-cf463596b0ab

    what is issue ? can you please share screen shot ?

  • User Avatar
    0
    Repunjay_TASC created

    ok got it; might be added some restriction that's why not able to load. Can you pls clear screen shots from chat.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Deleted.

  • User Avatar
    0
    Repunjay_TASC created

    Hi ,

    The dashboard board component does not load. I found the below Root cause analysis where the request is being blocking. The AppComponent module loads first whenever a URL is accessed, followed by the dashboard or any child component. The AppComponent loads without any issues; however, the request is not being sent to the dashboard because our current code receives the user's data with all parameters set to null.

    How can I retrieve the current user details in Angular? The backend successfully authenticates and authorizes the user, but I encounter an error when redirecting to the Angular dashboard.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you check the /api/abp/application-configuration http request? Share the request header and response info.

    This endpoint returns the current user info. The request header should have the authorization header.(jwt token)

    Thanks

  • User Avatar
    0
    Repunjay_TASC created

    ok let me check

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    ok

  • User Avatar
    0
    Repunjay_TASC created

    Can i share over email ?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    sure

  • User Avatar
    0
    Repunjay_TASC created

    I have shared information over email please check .

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share the HTTP request of api/abp/application-configuration?

    Include full request header and response JSON.

    Thanks.

  • User Avatar
    0
    Repunjay_TASC created

    Shared pls check

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    The request header doesn't contain the Authorization: bearer *.

    so the current user doesn't have values.

    Has your angular app been successful in getting access_token?

  • User Avatar
    0
    Repunjay_TASC created

    Without SSO OIDC able to login application.

    Also Authorization: bearer * also there. ..

    How to fix this issue with SSO OIDC ?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    How to fix this issue with SSO OIDC ?

    I don't know about your SSO OIDC code.

    Can you share the details and logs during the login?

  • User Avatar
    0
    Repunjay_TASC created

    Logs already shared with you, did you found anything inside log regarding this .But if you want i will shared one more time.

  • User Avatar
    0
    Repunjay_TASC created

    I have shared log over email kindly check and update.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    There isn't much information in the logs. Can your website be changed so that I can access it? That way I can reproduce the problem online.

  • User Avatar
    0
    Repunjay_TASC created

    Hi ,

    I have cross-verified the POC code and my code, and both are the same. I ran the POC project on my local machine, and it worked as expected, successfully redirecting to the dashboard.

    The request header also contain the Authorization: bearer *.

    <br> Please let me know if this approach will work. We are redirecting to the dashboard URL from the controller. Can we pass the Authorization: Bearer token inside the request? How do we set the Authorization: Bearer before redirecting to the dashboard? We will try this approach, so please advise on how to set the token before the redirect.

    Controller.cs

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    ler. Can we pass the Authorization: Bearer token inside the request? How do we set the Authorization: Bearer before redirecting to the dashboard? We will try this approach, so please advise on how to set the token before the redirect.

    The Bearer token will be added to the header in angular if you have access_token.

    See https://github.com/abpframework/abp/blob/rel-9.0/npm/ng-packs/packages/oauth/src/lib/interceptors/api.interceptor.ts#L41-L44

    Please make sure your angular obtains the access_token and id_token correctly.


    Angular will request the token endpoint to use code exchange the tokens for code flow.

    https://developer.okta.com/blog/2018/04/10/oauth-authorization-code-grant-type

    eg:

  • User Avatar
    0
    Repunjay_TASC created

    ok let me check

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06