<?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>Mon, 27 Jan 2014 11:33:10 -0500</lastBuildDate><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>