Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
redirecting and fetching the token generated after the authentication from okta

I am new to react and I am having a hard time figuring out this issue, so the backend is running on the Django, what I am trying to achieve is that from my frontend application I am able to log in to third party authentication system (Okta) on the API 127.0.0.1:8000/authenticate/login after the user is authenticated the page is redirected to the 127.0.0.1:8000/authenticate/saml where the tokens are generated for the user and that token are further used to get data from the database, I am having trouble to get to the part where I can fetch the token which are present in the JSON format

 const Token = () => {
  const urlLogin =    "http://127.0.0.1:8000/authentication/login/";
  const saml = 'http://127.0.0.1:8000/authentication/saml';
  

  useEffect(() => {
    // after the authentication is completed the used is directed to the token page
    window.location.href=urlLogin;// here authentication is being done
    const fetchApi = async () => {
      fetch(saml, {
        method: 'POST',
        mode: 'no-cors',

        headers: {
          'Content-Type': 'application/json',
        }

      }).then(response => console.log(response.read));
    }
    
    fetchApi();
  }, []);



about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!