<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Required double login on first time app usage</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=110567832" />
  <subtitle>Required double login on first time app usage</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=110567832</id>
  <updated>2026-04-04T15:13:55Z</updated>
  <dc:date>2026-04-04T15:13:55Z</dc:date>
  <entry>
    <title>RE: Required double login on first time app usage</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111914348" />
    <author>
      <name>Jenny trump</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111914348</id>
    <updated>2019-01-02T11:07:26Z</updated>
    <published>2019-01-02T11:07:26Z</published>
    <summary type="html">&lt;p&gt; Track user login status. like&lt;/p&gt;
&lt;p style="margin-left: 40.0px;"&gt; &lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;
    &lt;p style="margin-left: 40.0px;"&gt;while user login adds an entry that
      user is active or login&lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;
    &lt;p style="margin-left: 40.0px;"&gt;now while the user is trying to log
      in with another device at that time check that user is
      login/active or not. if a user is active then don't allow them for
      login and display a message that log out from your old device. You
      can also put auto logout from last device functionality also.&lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;
    &lt;p style="margin-left: 40.0px;"&gt;While the user is logged out at that
      time change user status active/login to not-active/logout so by
      this way you can manage this.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;You have to pass this user status with your login web Service or API
  in android and in the website you can directly check from DB.&lt;/p&gt;</summary>
    <dc:creator>Jenny trump</dc:creator>
    <dc:date>2019-01-02T11:07:26Z</dc:date>
  </entry>
  <entry>
    <title>RE: Required double login on first time app usage</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110589699" />
    <author>
      <name>Victor Galan</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110589699</id>
    <updated>2018-07-19T06:50:19Z</updated>
    <published>2018-07-19T06:50:19Z</published>
    <summary type="html">&lt;p&gt;Yeah, this way I can take a look into it :) my email is victor.galan@liferay.com&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks a lot!&lt;/p&gt;</summary>
    <dc:creator>Victor Galan</dc:creator>
    <dc:date>2018-07-19T06:50:19Z</dc:date>
  </entry>
  <entry>
    <title>RE: Required double login on first time app usage</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110587309" />
    <author>
      <name>Mateusz Wolak</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110587309</id>
    <updated>2018-07-18T14:20:58Z</updated>
    <published>2018-07-18T14:20:58Z</published>
    <summary type="html">&lt;p&gt;Hey,&lt;/p&gt;
&lt;p&gt;no, it isn't. It's on totally different activity, so if user log in
  correctly I redirect him to activity which holds WebScreenlet.&lt;/p&gt;
&lt;pre&gt;
@Override
public void onLoginSuccess(User user) {
   startActivity(new Intent(this, PrivateContentActivity.class));
}&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;If You would like, I can send You my current project on Your email.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Mateusz Wolak</dc:creator>
    <dc:date>2018-07-18T14:20:58Z</dc:date>
  </entry>
  <entry>
    <title>RE: Required double login on first time app usage</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110585216" />
    <author>
      <name>Victor Galan</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110585216</id>
    <updated>2018-07-18T07:30:07Z</updated>
    <published>2018-07-18T07:30:07Z</published>
    <summary type="html">&lt;p&gt;Hey,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;What I don't get yet is how are you showing this &amp;quot;Auto login
  portlet&amp;quot; is inside a WebScreenlet? Because I think it seems like
  the root of the problem, right?&lt;/p&gt;</summary>
    <dc:creator>Victor Galan</dc:creator>
    <dc:date>2018-07-18T07:30:07Z</dc:date>
  </entry>
  <entry>
    <title>RE: Required double login on first time app usage</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110578841" />
    <author>
      <name>Mateusz Wolak</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110578841</id>
    <updated>2018-07-17T14:50:32Z</updated>
    <published>2018-07-17T14:50:32Z</published>
    <summary type="html">&lt;p&gt;Hey,&lt;/p&gt;
&lt;p&gt;liferay_portlet_url contains relative url:
  &amp;quot;/group/guest/desktop&amp;quot; .&lt;br /&gt; My autologin screenlet work
  perfectly and it's not the problem.&lt;br /&gt; So I will try to explain it
  again:&lt;br /&gt; User installs my app for the first time.&lt;/p&gt;
&lt;p&gt;He sees login portlet as shown on screenshot_6.png.&lt;br /&gt; He enters
  proper credentials. &lt;br /&gt; Now he sees login portlet from liferay
  portal as shown on screenshot_5.png.&lt;br /&gt; If he enters proper
  credentials, he is redirected to /group/guest/desktop.&lt;br /&gt;
  &lt;br /&gt; Now when he logs out from app, he is redirected to login
  screenlet as shown on screenshot_6.png.&lt;br /&gt; He enters proper
  credentials.&lt;br /&gt; He is immediatly redirected to /group/guest/dekstop
  (he does not need to re login again using liferay login portlet).&lt;br /&gt;
  &lt;br /&gt; Hope it helps,&lt;br /&gt;
  &lt;br /&gt; Best regards&lt;/p&gt;</summary>
    <dc:creator>Mateusz Wolak</dc:creator>
    <dc:date>2018-07-17T14:50:32Z</dc:date>
  </entry>
  <entry>
    <title>RE: Required double login on first time app usage</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110576810" />
    <author>
      <name>Victor Galan</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110576810</id>
    <updated>2018-07-17T07:09:50Z</updated>
    <published>2018-07-17T07:09:50Z</published>
    <summary type="html">&lt;p&gt;Hey&lt;/p&gt;
&lt;p&gt;The Login Screenlet doesn't do any redirect at all or are you using OAuth2?&lt;/p&gt;
&lt;p&gt;Login screenlet has a save credential property that allows you to
  avoid login to the application each time &lt;a href="https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/accessing-the-liferay-session-in-android"&gt;https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/accessing-the-liferay-session-in-android&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Regarding the WebScreenlet code, this string:
  R.string.liferay_portlet_url is an absolute url? For this to work it
  should be a relative url&lt;/p&gt;
&lt;p&gt;I hope it helps&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Victor&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Victor Galan</dc:creator>
    <dc:date>2018-07-17T07:09:50Z</dc:date>
  </entry>
  <entry>
    <title>RE: Required double login on first time app usage</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110571151" />
    <author>
      <name>Mateusz Wolak</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110571151</id>
    <updated>2018-07-16T14:45:12Z</updated>
    <published>2018-07-16T14:45:12Z</published>
    <summary type="html">&lt;p&gt;I mean that whenever I run my app for the first time I need to login
  via login screenlet (and it's ok for me), but after that action it
  redirects me to my portal login page to login again to portal, as
  shown on the screenshot_5.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;My first portlet is autlogin which redirects to
  privatecontentactivity or mainactivity depending on if user is already
  logged in.  In Mainactivity on login success i start activity with
  privatecontenctactivity which contains WebScreenlet.&lt;br /&gt;
  &lt;br /&gt; The onCreate method from PrivateContentActivity looks
  like:&lt;br /&gt;  &lt;/p&gt;
&lt;pre&gt;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_private_content);

    observer = new CordovaLifeCycleObserver();

    WebScreenlet screenlet = (WebScreenlet) findViewById(R.id.web_screenlet);

    downloadManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);



    if (getResources().getString(R.string.liferay_portlet_url) != null) {
        WebScreenletConfiguration webScreenletConfiguration =
                new WebScreenletConfiguration.Builder(getResources().getString(R.string.liferay_portlet_url))
                        .addRawJs(R.raw.ebok_mobile_js, &amp;quot;ebok_mobile_js.js&amp;quot;)
                        //.addRawCss(R.raw.portletcss, &amp;quot;portlet.css&amp;quot;)
                        //.addLocalCss(&amp;quot;gallery.css&amp;quot;)
                        //.addLocalJs(&amp;quot;ebok_mobile_js.js&amp;quot;)
                        .enableCordova(observer)
                        .load();
        screenlet.setWebScreenletConfiguration(webScreenletConfiguration);

        screenlet.setListener(this);
        screenlet.setScrollEnabled(true);
        screenlet.load();


    }
}&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Mateusz Wolak</dc:creator>
    <dc:date>2018-07-16T14:45:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: Required double login on first time app usage</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110570344" />
    <author>
      <name>Victor Galan</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110570344</id>
    <updated>2018-07-16T14:12:55Z</updated>
    <published>2018-07-16T14:12:55Z</published>
    <summary type="html">&lt;p&gt;Hey,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;You are using a WebScreenlet, right? You mean that when you try to
  load your WebScreenlet it always load the login first?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Can you share the code where you are creating/loading the WebScreenlet?&lt;/p&gt;</summary>
    <dc:creator>Victor Galan</dc:creator>
    <dc:date>2018-07-16T14:12:55Z</dc:date>
  </entry>
  <entry>
    <title>Required double login on first time app usage</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110567831" />
    <author>
      <name>Mateusz Wolak</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110567831</id>
    <updated>2018-07-16T10:57:30Z</updated>
    <published>2018-07-16T10:57:30Z</published>
    <summary type="html">&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;when I install my app on any device I do need log in twice - first in
  login screenlet and then it redirects me to standard web liferay
  portal login portlet where I do need provide the same credentials
  again.&lt;br /&gt; It only occurs during first login using new app, whenever
  I try to log in the second, third time I need to log in using only
  login screenlet and then it redirects me correctly to portal home
  page.&lt;br /&gt; I think is might be something with certificate, that I am
  trusting?&lt;br /&gt; All hints would be helpful, thanks.&lt;br /&gt;
  &lt;br /&gt; Best regards&lt;/p&gt;</summary>
    <dc:creator>Mateusz Wolak</dc:creator>
    <dc:date>2018-07-16T10:57:30Z</dc:date>
  </entry>
</feed>
