我在我的SSO反应应用程序中集成了okta,我按照okta开发人员指南中提到的步骤进行了
这是我的index.js
import React, { Component } from 'react';
import { BrowserRouter as Router, Route } from 'react-router-dom';
import { Security, ImplicitCallback } from '@okta/okta-react';
import HomePage from './components/home/HomePage';
import ReactDOM from 'react-dom';
const config = {
issuer: 'https://XXX.oktapreview.com',
redirect_uri: window.location.origin + '/implicit/callback',
client_id: '0oxxxxxxxxxxxxx7'
}
class App extends Component {
render() {
return (
<Router>
<Security issuer={config.issuer}
client_id={config.client_id}
redirect_uri={config.redirect_uri}
>
<Route path='/' exact={true} component={HomePage}/>
<Route path='/implicit/callback' component={ImplicitCallback}/>
</Security>
</Router>
);
}
}
ReactDOM.render(<App/>, document.getElementById('app'));
不断获取无法GET /隐式/回调。 我在okta中的应用配置如下: enter image description here
我猜测webpack配置有问题。
答案 0 :(得分:0)
看起来只是webpack的问题,当我删除时,output: {
path: __dirname + '/dist',
filename: "index_bundle.js",
publicPath: '/',
crossOriginLoading: 'anonymous'
}
它至少在本地工作但仍然没有在生产环境中
'e.id'
以前有人遇到过这个吗?