Open Closed

Not able to launch React application Login page #1839


User avatar
0
JeganAbpCommercial created

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v4.4.0
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): Application Template
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

We have created new solution based Application Template asi mentioned above. Our front end we are planning to use React application (customized) and backed we are going to use web api which is created by abp mvc application template. Now we are trying to integrate the login functionality with identity server. Both API and identity server hosting together along mvc ui.

Note: MVC UI we are not going to use for now

Issue

Now from react application we try to access launch url localhost:3000, it automatically redirect to MVC login page(generated by ABP) (our designed login page is not in use anymore) . how to resolve this issue ?.. Please help


1 Answer(s)
  • User Avatar
    0
    gterdem created
    Support Team Senior .NET Developer

    I am guessing you want to login to your application through react application and not redirect to Authorization Server (backend).

    Default suggested authentication flow for SPA applications is Authorization Code with PKCE because of security reasons.

    You can check our documentations about it: https://docs.abp.io/en/abp/latest/UI/Angular/Authorization#resource-owner-password-flow If you don't set responseType it will be password flow automatically.

    For more detailed information about the flow:

    Update your identityserver clients:

    You need to add your client to identity server with grant type and a secret. Sample can be found here: https://docs.identityserver.io/en/release/quickstarts/2_resource_owner_passwords.html

    Update your client (react app):

    Eventually create a url to make the request to authorize endpoint. Here is some documentation from auth0 about what the url should look like: https://auth0.com/docs/authorization/flows/call-your-api-using-resource-owner-password-flow. There should be react libraries easing client request process.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11