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

186
Visualizações
login for website within website integration

so I have a requirement where I need to handle a case wherein when you log in to one website, we need to be allowed to log in to another website

Let me explain Say there is a parent website and a child website, both these websites have the user details of who is going to be logged in.

    //PARENT WEBSITE
    <!DOCTYPE html>
    <html>
    <body>
    <iframe src="https://childwebsiteurl?param=parentwebsitetoken" title="this is child website">
    </iframe>
    </body>
    </html>

So I want a solution basically where when I log in to the parent website, I should be logged in to the child website also.

Right now I have one solution in mind: When the user logs in to the parent website, I will get a token and that token I will then past it to the child website(here we are assuming that the backend of both child and parent website has means to verify the token, n both has the user information) and that way I can log in to child website and child website is shown in the iframe of the parent website.

My only concern is, is there a standard way to do this, or is what I have proposed is it proper?

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I imagine that you can approach that by simply storing your session token in localStorage once logged in parent website.

Since localStorage is unique and not cannot be shared across different origins, you might want to implement cross-domain-local-storage: (https://github.com/zendesk/cross-storage). This should be done if parent website and child website don't share the same domain, or even if the child is a subdomain of the parent.

Once you got that implementation, in client-side of child website you can just read your localStorage at mount-time and check if there is a valid token there, if so, just log the user in.

All of this assuming that both system just require a valid token in order to grant permissions to the client, if you just pass the token generated on the first website, you don't need to pass user's login info to login in the child website, because the token is already generated for that user.

You could as well post non-sensitive data to your cross-storage to improve customization, such as the user's name.

about 4 years ago · Juan Pablo Isaza Relatório

0

You need Single Sign On solution (there are many such solutions), or JWT token..

Both of these solutions would log you on any website (parent/child/other) where you have SSO integration or JWT integration.

For Angular websites JWT token is more appropriate.

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