Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

148
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda