You can do this if you have control (code control) over the app inside the iframe and they are from the same FQDN.
Create 2 pages in liferay like /home
& /login
, both would have iframe portlet configured with different URLs.
/home
: This would show your initial iframe-portlet and on click of the login button in your app you can give the URL for /login
page which would have a one-app layout and iframe would fill in the whole page.
/login
: This page would have the URL configured in iframe of the page which appears in your app after you click login.
OR
You can have an onLoad script in your app within the iframe for the second page which appears after clicking on login, this script would maximize your iFrame when the second page is loaded inside iframe.
OR
You can use a hook to have a script in your iframe portlet to increase the height and width of the iFrame dynamically based on the content within.
But for the second & third method to work you would need that Liferay and the app inside iFrame share the same FQDN, or else your script won't work due to cross-domain scripting security.
For method's second and third here are some solutions:
What if you don't have control over the child-app and have a different FQDN?
If you do not have control over the child-app inside iFrame then my friend you are out-of-luck here since iFrame does not have access to the child-page (due to security reasons) nor does the child-page knows anything about the parent.
Here is another link that explains a lot and offers some solutions based on easyxdm which allows Cross-domain messaging:
Hope this helps.