@okta/okta-react-native latest version not working with react-native mobile app

Error: Sign in was not authorized
at construct (native)
at apply (native) getting this error both from android and iOS in react-native.
Before that I’m calling isAuthenticate() function which is also returning
authenticated: false.
Already have created the account okta.developer.com dashboard and created the application.
Let me know how to proceed to get login, I’m trying customLogin method, signinbrowser also not working.

There are not enough details to help you here at this point.

Could you please share more information about the exact steps you are taking, what tools or frameworks you are using, and what our system logs show when the login fails? What troubleshooting steps you have tried?
Can you also create a support ticket ?

Also, are you using our SDK?
You can refer to the React Native SDK here:
:link: Okta React Native SDK – Getting Started

I’m trying to integrate below sdk in hybrid app supporting react-native platform both for iOS and android. i already went through the React Native SDK:
:link: Okta React Native SDK – Getting Started but no luck.
Here are the steps I followed to integrate:
FYI, we already have okta developer account for OIDC client with all the things configured.

  1. using “@okta/okta-react-native”: “^2.17.0”,

  2. export default {
    oidc: {
    issuer: ‘https://dev-********.okta.com/oauth2/default’,
    clientId: ‘0oaodpw9f5n55n5aFm5d7’,
    redirectUri: ‘com.okta.dev-:/callback’,
    endSessionRedirectUri: 'dev-
    .okta.com’,
    discoveryUri: ‘https://dev-*******.okta.com/oauth2/default’,
    scopes: [‘openid’, ‘profile’, ‘email’, ‘offline_access’],
    requireHardwareBackedKeyStore: false,
    // androidChromeTabColor: “#FF00AA”, // Optional
    browserMatchAll: true, // Optional
    httpConnectionTimeout: 15, // Optional
    httpReadTimeout: 10, // Optional
    },
    };

  3. initilize the above config props using createConfig in-build function of @okta/okta-react-native library.

  4. When step 3 is done async calling below function:
    const result = await isAuthenticated();
    console.log(‘isAuthenticate’, result);
    which always return false in the result.

  5. In the next step, in UI I’m trying to get login with username and password through custom login (the user info is available on okta.developer.com dashboard under People section and which is active)

  6. When I trying to login i passed credentials in signIn({ username: domainID, password: secret }) function provided by okta and it is going to catch block with the above mention error in the title.

for android i tried to add below in build.gradle defaultConfig section
manifestPlaceholders = [
appAuthRedirectScheme: ‘customUriScheme’
]

or
manifestPlaceholders = [
appAuthRedirectScheme: ‘com.okta.dev-********’
]
But no luck.
FYI
“react”: “18.3.1”,
“react-native”: “0.77.2”

So, these are the steps *
let me know if more info is required or something I’m missing with it for both platforms. Everything is up and running in the app. How to get avoid this error @krishna

Note: the behavior is same for both android and iOS.
console error for iOS:
login error ==========> Error: Sign in was not authorized
at construct (native)
at apply (native)
at _construct (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server&app=com.abc.def:28648:106)
at Wrapper (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server&app=com.abc.def:28622:64)
at construct (native)
at _callSuper (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server&app=com.abc.def:431322:170)
at OktaAuthError (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server&app=com.abc.def:431354:25)
at anonymous (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server&app=com.abc.def:431516:34)
at tryCallOne (address at InternalBytecode.js:1:1180)
at anonymous (address at InternalBytecode.js:1:1874)

How to create it, please help me out here?
Also, are you using our SDK? => Yes
Thank you!

@andrea ^^ can you please also look into this initial login issue?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.