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

173
Visualizações
Javascript authenticate website using included script

I want to have one application, that serves javascript code performing stuff such as cookies management or run validation and so on and other website, that includes this code. The thing is, the script should perform GET and POST on the server and should somehow authenticate itself. For example when user accepts cookie form, this consent should be sent to the server so it could be stored as a proof to our authorities, but every website will have different users and I want to identify them for each website. Also, there should't be a way of forging the requests leading to false data. This should go as follows:

  1. server.com provides javascript and database of consents.

  2. User goes to example.com that has this javascript included.

  3. User clicks accept.

  4. Website sends this information to server.com

  5. Server.com checks, if the request was really sent by example.com and writes to db.

  6. Everyone is happy.

It could work somehow like google analytics identifies the website? (Don't know how) I've spent too much time googling and going through source codes and couldn't find anything.

EDIT: I was thinking of taking advantage of CORS. Site will send request to server and it will respond with some token and set Access-Control-Allow-Origin and the site will now on use this token, that will be valid only for a certain period of time, maybe usage count limited. Would this be reasonable solution? Could this be somehow forged?

about 4 years ago · Juan Pablo Isaza
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