Any users assigned either via groups assigned to the app, or via ‘Everyone’ group or via individual assignments do not work, returning 401 error.
App.js →
const history = useHistory();
const customAuthHandler = () => {
history.push('/login');
};
const restoreOriginalUri = async (_oktaAuth, originalUri) => {
history.replace(toRelativeUrl(originalUri || '/', window.location.origin));
};
return (
<Security>
oktaAuth={oktaAuth}
onAuthRequired={customAuthHandler}
restoreOriginalUri={restoreOriginalUri}
>
<Switch>
<Route exact path="/" render={() => <Home />} />
<Route path="/login" render={() => <Login />} />
<Route path="/login/callback" component={LoginCallback} />
<SecureRoute path="/users" render={() => <List />} />
.......
</Switch>
</Security>
);
The login page has the default embedded Okta SignIn Widget as mentioned in the react okta docs here - Sign in to your SPA with the embedded Okta Sign-In Widget | Okta Developer
(the mentioned src/Login.jsx
and src/OktaSignInWidget.jsx
are almost similar)
Following is config.js
export const securityConfig = {
oidc: {
issuer: 'https://{domain}/oauth2/default',
clientId: 'clientId',
scopes: ['openid', 'profile', 'email', 'address', 'phone', 'offline_access'],
redirectUri: 'http://localhost:3000/login/callback'
},
widget: {
issuer: 'https://{domain}/oauth2/default',
clientId: 'clientId',
redirectUri: 'http://localhost:3000/login/callback',
scopes: ['openid', 'profile', 'email', 'address', 'phone', 'offline_access'],
useInteractionCodeFlow: true,
colors: {
brand: '#44acac'
}
}
};
What do I seem to be missing here, the okta react widget is almost identical to the one in the docs, any users used are assigned to the app in one way or the other yet the widget shows access denied. Is this a generic message which is displayed for many errors? Any help would be appreciated.