登录到外部网址,然后返回到Angular应用程序。

huangapple go评论110阅读模式
英文:

login to external url and come back to angular app

问题

我的问题是我有一个外部网址,我需要调用这个外部网址(由另一个客户端创建),然后需要返回到主页。我在我的ts文件中写了以下代码:

<button class="altro" title="(click)="effettuaLoginExternal($event)">登录</button>

在我的ts文件中,我写了:

effettuaLoginExternal(event) {
    window.location.href="/external/login";
}

当我执行 window.location.href="/external/login"; 时,会打开这个外部网址,我可以输入用户名和密码,但是在点击“确定”按钮后无法返回到Angular应用程序。我没有这个外部网址的代码。有人可以帮我吗?

英文:

My problem is that I have and external url, I need to call this external url (created by another client) and after I need to come back into home page. I do

 &lt;button class=&quot;altro&quot; title=&quot; (click)=&quot;effettuaLoginExternal($event)&quot;&gt;login&lt;/button&gt;

in my ts I do:

  effettuaLoginExternal(event) {

   
      window.location.href=&quot;/external/login&quot;;
}

when I Do window.location.href=&quot;/external/login&quot;; open this external url and I can insert the username and password but I cannot back to angular application after I click on button "ok" . I don't have the code of this external url. Anyone can help me?

答案1

得分: 2

如果用户需要离开您的网站并与第三方网站互动,那么他们唯一能够返回您的网站的方式是第三方网站将他们发送回来。


如果没有第三方的合作,最接近的方式是在新窗口或框架中打开他们的网站。您将无法从第三方网站收集任何数据(例如,您无法确认用户成功登录到第三方网站),您将依赖用户在准备好时点击返回到您网站的窗口。

英文:

If the user needs to leave your site and interact with a third-party site, then the only way they are going to return to your site is if the third party-side sends them back.


The closest you could come without the cooperation of the third-party would be to open their site in a new window or a frame. You would not be able to collect any data from the third-party site (e.g. you could not confirm the user logged into the third-party site successfully) and you would depend on the user to click back on the window for your site when they were ready.

huangapple
  • 本文由 发表于 2023年8月9日 18:35:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/76866921.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定