Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

147
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda