Is oktaAuth state config option available on okta-react-native

We are building a web application and a react native mobile application that uses the respective okta libraries.

We have a token hook setup in okta that takes variables passed to it via the config state and then it adds some info to the token.

In our web implementation, we define the state in the config option below.

It seems that the state field is not available on the okta-react-native implementation. Is it possible to send state with this library? or is this feature not yet implemented?


Our token hook just gets a random string, which is the default value for this field, when using okta-react-native.

Any help is appreciated,
Thank you!

Can you try passing in an oktaAuthConfig into the createConfig method, with the ‘state’ set in the oktaAuthConfig object? It looks like this should be possible since okta-react-native v1.12.0

Perfect, thank you for the quick reply. I will try this first thing tomorrow and get back to you but this looks like it should work.

After looking at this approach, it doesn’t seem to work for our needs.

It appears that the js okta auth library is not used for the authorization part of this. It uses a native ios/android okta auth instance. The okta-react-native library doesn’t pass state into those. See the line below, it just passes in the session token.

State is not defined in the native module config

Hmm… you’re right, it doesn’t look like we support just any parameter be added. Can you open an issue on Github for this?