Login to external url and back using Angular app
P粉316890884
2023-08-09 16:19:25
<p>My problem is, I have an external link and I need to call this external link (created by another client) and then I need to go back to the homepage. What I did was: </p>
<pre class="brush:php;toolbar:false;"><button class="altro" title="(click)="effettuaLoginExternal($event)">Login</button></ pre>
<p>In my ts file I do this: </p>
<pre class="brush:php;toolbar:false;">effettuaLoginExternal(event) {
window.location.href="/external/login";
}</pre>
<p>When I execute <code>window.location.href="/external/login";</code>, this external link opens and I can enter the username and password, but after I click "OK Can't return to Angular application after pressing " button. I don't have the code for this external link. Can anyone help me? </p>
If a user needs to leave your site and interact with a third-party site, their only way back to your site is to receive a return instruction sent by the third-party site.
If you don't get the cooperation of a third-party site, the closest you can probably get is to open its site in a new window or frame. You won't be able to collect any data from the third-party site (for example, you won't be able to confirm that the user successfully logged into the third-party site), and you will rely on the user to click the back button on the window to return to your site when they are ready.