<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to verify username/password of user without logging in?</title><link>https://answers.axonivy.com/questions/3085/how-to-verify-username-password-of-user-without-logging-in</link><description>&lt;p&gt;Hi all&lt;/p&gt;
&lt;p&gt;Normally when we want to check whether user is authenticated ivy user or not, we use this api:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Ivy.session().loginSessionUser(userName, password)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But this api will also change the current login user to new one. &lt;/p&gt;
&lt;p&gt;Is there any other api to verify user/pass without logout current user?&lt;/p&gt;
&lt;p&gt;Because my process is an ivy webservice then it's run with &lt;code&gt;system&lt;/code&gt; permission, if i use above api to verify another user it will throw exception that i can't logout of &lt;code&gt;system&lt;/code&gt; user.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/3085/how-to-verify-username-password-of-user-without-logging-in" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 01 Feb 2018 07:27:26 -0500</lastBuildDate><item><title>Comment by trungdv on Reto Weiss's answer</title><link>https://answers.axonivy.com/questions/3085/how-to-verify-username-password-of-user-without-logging-in#3090</link><description>&lt;p&gt;thanks Reto Weiss ♦♦
it's helpful for me&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">trungdv</dc:creator><pubDate>Thu, 01 Feb 2018 07:27:26 -0500</pubDate><guid>https://answers.axonivy.com/questions/3085/how-to-verify-username-password-of-user-without-logging-in#3090</guid></item><item><title>Answer by Reto Weiss</title><link>https://answers.axonivy.com/questions/3085/how-to-verify-username-password-of-user-without-logging-in/3089</link><description>&lt;p&gt;Hi &lt;/p&gt;
&lt;p&gt;You can create a new session. Then, use it to authenticate the user and finally destroy the session again.&lt;/p&gt;
&lt;p&gt;See invisible API (API is not visible in content assist but is there and can be used):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ISession session = ivy.wf.getSecurityContext().createSession();
try
{
  session.loginSessionUser(...)
}
finally
{
  ivy.wf.getSecurityContext().destroySesssion(session.getIdentifier());
}
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Thu, 01 Feb 2018 06:17:42 -0500</pubDate><guid>https://answers.axonivy.com/questions/3085/how-to-verify-username-password-of-user-without-logging-in/3089</guid></item></channel></rss>