Score:0

How do I ensure that website (a react webapp) can only be accessed as a redirection from another website, and not directly

in flag

I am running a SAAS company that is websited at www.mycompany.com, and I have a business-partner that is websited at www.mypartner.com. I'd like to redirect a user which is logged-in to www.mypartner.com portal to www.mycompany.com without requiring the user to login again.

I understand that oAuth 2.0 is the right solution to this problem. I am wondering, however, if there are any lighter alternatives, since customer doesnt use oAuth (they have a simple postgres table with uname/passwords, and an old php based website).

So far, this is a solution I have come up with:

  1. The user is logged-in into www.mypartner.com, and hence, we have the user's details like their name, email-address, customer no. etc

  2. We can ask www.mypartner.com developers to redirect the user to our website at www.mycompany.com, while putting the user details in the header. Since both websites are https, an eavesdropper cannot get these values

  3. www.mycompany.com can then create / retrieve the user that matches the passed info, pre-fill the form etc and carry on the business

Are there any major drawbacks in this solution?

One concern I have is that anyone can put these fields into the header and log-in to www.mycompany.com. To avoid this, is it possible to ensure the following:

  1. No one can access www.mycompany.com unless they are being redirected from www.mypartner.com ?
Michael Hampton avatar
cz flag
Yes, with oAuth.
Paul avatar
cn flag
Please consider using RC2606-compliant TLDs or [example second level domain names](https://datatracker.ietf.org/doc/html/rfc2606#section-3). Using other URLs can confuse people or send them to malware-infected domains. Note that `mypartner.com` is a squatter domain, where malware can commonly reside.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.