<?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 authenticate a user that is provided by a Single Sign On (SSO) proxy.</title><link>https://answers.axonivy.com/questions/506/how-to-authenticate-a-user-that-is-provided-by-a-single-sign-on-sso-proxy</link><description>&lt;p&gt;We've got a SSO-Proxy for most of our web applications. I'd like to make use of the SSO-Proxy instead of requiring the user to login with his Windows credentials.&lt;/p&gt;
&lt;p&gt;I've figured out how I can read the HTTP header containing the user-id. Now I'd like to authenticate as this user, but all provided methods require a password. Is there anyway I can authenticate a user only by his user-id?&lt;/p&gt;
&lt;p&gt;This is what I've got to get the user-id:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;package ch.company.ivy.security;

import java.util.Map;

import javax.faces.context.FacesContext;

public class Auth {
    Map&amp;lt;String, String&amp;gt; headers;
    String userId;

    public Auth() {
        headers = FacesContext.getCurrentInstance().getExternalContext().getRequestHeaderMap();
        userId = headers.get("UID").toString();
    }

    public String getUserId() {
        return this.userId;
    }
}
&lt;/code&gt;&lt;/pre&gt;</description><atom:link href="https://answers.axonivy.com/questions/506/how-to-authenticate-a-user-that-is-provided-by-a-single-sign-on-sso-proxy" rel="self"></atom:link><language>en</language><lastBuildDate>Wed, 26 Apr 2017 06:18:31 -0400</lastBuildDate><item><title>Comment by thienqh on Reto Weiss's answer</title><link>https://answers.axonivy.com/questions/506/how-to-authenticate-a-user-that-is-provided-by-a-single-sign-on-sso-proxy#2599</link><description>&lt;p&gt;I asked a new question for my problem &lt;a href="http://answers.axonivy.com/questions/2597/how-to-set-information-for-logon-iuser-without-permanently-store-to-system"&gt;http://answers.axonivy.com/questions/2597/how-to-set-information-for-logon-iuser-without-permanently-store-to-system&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">thienqh</dc:creator><pubDate>Wed, 26 Apr 2017 06:18:31 -0400</pubDate><guid>https://answers.axonivy.com/questions/506/how-to-authenticate-a-user-that-is-provided-by-a-single-sign-on-sso-proxy#2599</guid></item><item><title>Comment by Reto Weiss on Reto Weiss's answer</title><link>https://answers.axonivy.com/questions/506/how-to-authenticate-a-user-that-is-provided-by-a-single-sign-on-sso-proxy#2598</link><description>&lt;p&gt;No, there is no such API. IUser is always backed in the database. 
What is the use case?  Setting the fullname from a SSO Proxy seems to be weird?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Wed, 26 Apr 2017 02:44:49 -0400</pubDate><guid>https://answers.axonivy.com/questions/506/how-to-authenticate-a-user-that-is-provided-by-a-single-sign-on-sso-proxy#2598</guid></item><item><title>Comment by thienqh on Reto Weiss's answer</title><link>https://answers.axonivy.com/questions/506/how-to-authenticate-a-user-that-is-provided-by-a-single-sign-on-sso-proxy#2594</link><description>&lt;p&gt;Hi Reto,
After I retrieved the IUser by using:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;IUser user = ivy.session.getSecurityContext().findUser(userName);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;then set some basic information for this user likes&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user.setFullName("MyFullname");
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It seem override the information of User in database also.
I wonder if there is any API to working with IUser without affect to the database?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">thienqh</dc:creator><pubDate>Tue, 25 Apr 2017 07:06:03 -0400</pubDate><guid>https://answers.axonivy.com/questions/506/how-to-authenticate-a-user-that-is-provided-by-a-single-sign-on-sso-proxy#2594</guid></item><item><title>Comment by ahatius on Reto Weiss's answer</title><link>https://answers.axonivy.com/questions/506/how-to-authenticate-a-user-that-is-provided-by-a-single-sign-on-sso-proxy#508</link><description>&lt;p&gt;I'll check this with our SSO guys, there seems to be a tomcat-sso integration :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ahatius</dc:creator><pubDate>Tue, 28 Jan 2014 10:10:59 -0500</pubDate><guid>https://answers.axonivy.com/questions/506/how-to-authenticate-a-user-that-is-provided-by-a-single-sign-on-sso-proxy#508</guid></item><item><title>Answer by Reto Weiss</title><link>https://answers.axonivy.com/questions/506/how-to-authenticate-a-user-that-is-provided-by-a-single-sign-on-sso-proxy/507</link><description>&lt;p&gt;Xpert.ivy uses internally an embedded Tomcat web server. Maybe your SSO-Proxy delivers support for Tomcat (e.g. a Tomcat valve or realm or filter) so
that Tomcat can use the user information from your SSO Proxy and provides them to the deployed web applications. 
Xpert.ivy is such a deployed web application and will read the user information provided by Tomcat. 
If there is an Xpert.ivy user that has the same name as the one provided by Tomcat it will automatically authenticated the user without any further configuration or logic necessary.&lt;/p&gt;
&lt;p&gt;Overview how this works:&lt;/p&gt;
&lt;p&gt;Client -&amp;gt; SSO-Proxy -&amp;gt; Tomcat -&amp;gt; SSO-Proxy-Valve -&amp;gt; Xpert.ivy&lt;/p&gt;
&lt;p&gt;SSO-Proxy: Delivers user name in UID http parameter&lt;/p&gt;
&lt;p&gt;SSO-Proxy-Value: Reads UID parameter and sets user principal on the tomcat request &lt;/p&gt;
&lt;p&gt;Xpert.ivy: Reads the user principal from the tomcat request and lookup a Xpert.ivy user with the same name. If it founds one it will be authenticate on the session automatically.&lt;/p&gt;
&lt;p&gt;This works similar to SSO with IIS described in the &lt;a href="http://xpertivy.ch/releases/Xpert.ivy/5.0.latest/documents/ServerGuideHtml/ivy.server.integration.iis.html#N216F1"&gt;Server Guide&lt;/a&gt;. The main difference is that you have to install and configure the SSO-Proxy specific Tomcat value, realm or filter. The corresponding tomcat configuration files are located at:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;/webapps/ivy/WEB-INF/web.xml&lt;/li&gt;
&lt;li&gt;/webapps/ivy/META-INF/context.xml                &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;However, there is also an API to do something similar in your process: &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import ch.ivyteam.ivy.security.IUser;

String userName = ivy.request.getParameter("UID").toString();
IUser user = ivy.session.getSecurityContext().findUser(userName);
ivy.session.authenticateSessionUser(user, "SSO-Proxy");
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Mon, 27 Jan 2014 11:33:10 -0500</pubDate><guid>https://answers.axonivy.com/questions/506/how-to-authenticate-a-user-that-is-provided-by-a-single-sign-on-sso-proxy/507</guid></item></channel></rss>