abp icon indicating copy to clipboard operation
abp copied to clipboard

can not login using reactnative

Open amira133 opened this issue 3 years ago • 5 comments

Hi I create a fresh abp project (using abp new Acme.BookStore -u angular -dbms PostgreSQL -m react-native --pwa -csf) and hosted in https://test.wedin.ir/ but when I want to login using reactnative ,it says invalid_client in other hand my angular project worked correctly with same clientId. What should I do?

my react-native Environment.js:

const yourIP = 'localhost'; // See the docs https://docs.abp.io/en/abp/latest/Getting-Started-React-Native?Tiered=No
const port  = 44384;
// const apiUrl = `https://${yourIP}:${port}`;
const apiUrl = `https://test.wedin.ir`;
const ENV = {
  dev: {
    apiUrl: apiUrl,
    oAuthConfig: {
      issuer: apiUrl,
      clientId: 'BookStore_App',
      
      scope: 'offline_access BookStore',
    },
    localization: {
      defaultResourceName: 'BookStore',
    },
  },
  prod: {
    apiUrl: 'https://test.wedin.ir',
    oAuthConfig: {
      issuer: 'https://test.wedin.ir',
      clientId: 'BookStore_App',
      scope: 'offline_access BookStore',
    },
    localization: {
      defaultResourceName: 'BookStore',
    },
  },
};

my angular environment.ts :

export const environment = {
  production: false,
  application: {
    baseUrl,
    name: 'BookStore',
    logoUrl: '',
  },
  oAuthConfig: {
    issuer: 'https://test.wedin.ir/',
    redirectUri: baseUrl,
    clientId: 'BookStore_App',
    responseType: 'code',
    scope: 'offline_access BookStore',
    requireHttps: true,
  },
  apis: {
    default: {
      url: 'https://test.wedin.ir',
      rootNamespace: 'Acme.BookStore',
    },
  },
} as Environment;

abp version 7.1

amira133 avatar Apr 18 '23 19:04 amira133

,it says invalid_client

Whats the detailed error message?

maliming avatar Apr 19 '23 01:04 maliming

it shows this errors and warning in my terminal WARN Possible Unhandled Promise Rejection (id: 0):

TypeError: undefined is not an object (evaluating 'delete state.activeLoadings[action.payload.key]')
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:251659:54
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:190016:33
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:188507:20
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:190015:46
reduce@[native code]
reducer@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:189996:33
combination@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:188888:38
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:247599:33
dispatch@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:188746:38
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:250904:28
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:191516:27
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:25786:31
tryCallOne@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:25621:16
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:25702:27
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:26597:26
_callTimer@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:26516:17
_callReactNativeMicrotasksPass@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:26546:17
callReactNativeMicrotasks@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:26709:44
__callReactNativeMicrotasks@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:20146:46
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:19958:45
__guard@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:20130:15
flushedQueue@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:19957:21
flushedQueue@[native code]
callFunctionReturnFlushedQueue@[native code]
 WARN  Possible Unhandled Promise Rejection (id: 1):
TypeError: undefined is not an object (evaluating 'delete state.activeLoadings[action.payload.key]')
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:251659:54
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:190016:33
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:188507:20
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:190015:46
reduce@[native code]
reducer@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:189996:33
combination@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:188888:38
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:247599:33
dispatch@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:188746:38
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:250904:28
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:191516:27
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:25786:31
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:191516:27
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:25786:31
tryCallOne@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:25621:16
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:25702:27
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:26597:26
_callTimer@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:26516:17
_callReactNativeMicrotasksPass@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:26546:17
callReactNativeMicrotasks@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:26709:44
__callReactNativeMicrotasks@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:20146:46
http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:19958:45
__guard@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:20130:15
flushedQueue@http://172.21.48.17:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:19957:21
flushedQueue@[native code]
callFunctionReturnFlushedQueue@[native code]

Screenshot 1 Screenshot 2

If there is a more detailed log elsewhere, please let me know and I will send it. also you can try using my server https://test.wedin.ir/ @maliming please review my question, I have added some details to it

amira133 avatar Apr 19 '23 07:04 amira133

Hi Did not result?

amira133 avatar May 01 '23 11:05 amira133

Hi @amira133,
Just remove &client_secret=${oAuthConfig.clientSecret} from login method in src/api/AccountAPI.js . This will solve your problem and I will release a patch for this issue.

bariscanyilmaz avatar May 02 '23 13:05 bariscanyilmaz

i have tried with removing the client secret from login method but still i couldnt get rid of that error

ShifanilaSenthil avatar Jan 04 '24 09:01 ShifanilaSenthil