That means you're doing things right so far. The script above simply embeds a viz into a web page It doesn't attempt to do "Single Sign On".
If you don't want the user to need to login separately, and for Tableau to "respect" the login of the portal into which the user has already logged in, you should google "Tableau Trusted Authentication". I'll warn you that Trusted Tickets is a bit more advanced, however -- it'll take coding on your part for which there is no easy "copy and paste" solution likely you did above
Small steps! You're doing great!