Open Closed

How to configure OpenIdDict in a production environment for React Native? #6159


User avatar
0
lizhaofeng created
  • ABP Framework version: v7.4.1

  • UI Type: MVC & React Native

  • Database System: MongoDB

  • Tiered (for MVC) or Auth Server Separated (for Angular): no

  • Exception message and full stack trace:

  • Steps to reproduce the issue:

The API service is deployed at http://192.168.1.21:44376

  1. How to configure the environment in React Native?

  2. How to configure RedirectUris for OpenIdDict ?


4 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Configure the oAuthConfig in the Environment.js of the React app.
    Configure the URLs in the appsettings.json of the DbMigrator app.

    https://docs.abp.io/en/abp/latest/Deployment/Configuring-OpenIddict

  • User Avatar
    0
    lizhaofeng created

    hi maliming,

    1.The OpenId
    image.png

    2.RN config
    image.png

    3.Encountering a 400 error after logging in.
    image.png

    AuthService Log
    https://gist.github.com/zhaofenglee/3f784b2e7adf88c26ea8cd782a4a3d52

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    2023-11-13 11:06:04.944 +08:00 [INF] Antiforgery token validation failed. The provided antiforgery token was meant for a different claims-based user than the current user.
    2023-11-13 11:06:04.949 +08:00 [INF] Executing StatusCodeResult, setting HTTP status code 400

    This error has nothing to do with openiddict.

    This is usually a problem with cookies. Please check the message from the browser console. Or try to use https

  • User Avatar
    0
    lizhaofeng created

    hi

    The issue is resolved when using https.

    Thanks。

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on April 16, 2025, 12:13