<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D51Y00008QnxysSABOkta Classic EngineAdministrationAnswered2020-05-20T17:55:57.000Z2020-05-12T15:51:27.000Z2020-05-20T17:55:57.000Z

DanielleS.76641 (Customer) asked a question.

Python, flask, react app | login with okta returning 400 bad request error

I'm trying to recreate the python, flask, react app from this blog post (https://developer.okta.com/blog/2018/12/20/crud-app-with-python-flask-react) and when I click on the login with okta button I'm getting a 400 bad request error. It says my client id is invalid, but it matches the client id listed on my SPA general tab.

 

Here is my code from the Main/index.js file:

 

import React, { Component } from 'react';

import { Switch, Route, BrowserRouter as Router } from 'react-router-dom'

import { Security, ImplicitCallback, SecureRoute } from '@okta/okta-react';

 

import Login from '../Login'

import Home from '../Home'

 

class Main extends Component {

 render() {

   return (

     <Router>

       <Security

         issuer={'https://student-dev-870557.okta.com'}

         client_id={'0oabtc9zsGJXMWajx4x6'}

         redirect_uri={'http://localhost:8080/implicit/callback'}

         scope={['openid', 'profile', 'email']}>

        

         <Switch>

           <Route exact path="/" component={Login} />

           <Route path="/implicit/callback" component={ImplicitCallback} />

           <SecureRoute path="/home" component={Home} />

         </Switch>

       </Security>

     </Router>

   );

 }

}

 

export default Main;

 

Can someone help?

 


This question is closed.
Loading
Python, flask, react app | login with okta returning 400 bad request error
Okta Support Agent (Beta)

Terms of Service

Hello! I'm the Okta Support Agent (Beta), your go-to resource for questions about Okta products. Please remember for your security and privacy, do not share any Personally Identifiable Information (PII) such as passwords, IP addresses, or other details with me.

Okta Privacy Policy and Terms of Service apply