okta-react icon indicating copy to clipboard operation
okta-react copied to clipboard

Okta sign in widget is not using the global OktaAuth instance, so its configuration is incorrect

Open distinctdan opened this issue 3 years ago • 3 comments

The react docs say to create an instance of the okta signin widget. This widget appears to create it's own OktaAuth instance instead of using the one from Context or hooks. This results in its configuration not matching the global one. Currently, users have to duplicate all of their configuration params between the global instance and the config for the sign in widget. However, this behavior is not documented.

Specifically, in the example in the docs, the global OktaAuth instance is passed the issuer property, but it's not passed to the signin widget, which results in the sign in widget not working if you're using a custom issuer.

I propose the following changes:

  • The signin widget should be changed to allow passing in an instance of OktaAuth instead of creating its own. It would be even better if it could pick it up automatically from react's context, but that would make it react-specific, which doesn't look like it's currently supported. I've filed a separate issue on the signin widget page here.
  • In the meantime, update the react widget docs to warn that the sign in widget does its own thing and needs all OktaAuth config params to be duplicated in the authParams property.

distinctdan avatar Mar 03 '21 18:03 distinctdan