<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 26 Mar 2016, at 13:49, Karli Sjöberg &lt;<a href="mailto:Karli.Sjoberg@slu.se" class="">Karli.Sjoberg@slu.se</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On 26 Mar 2016, at 11:35, Ondra Machacek &lt;<a href="mailto:omachace@redhat.com" class="">omachace@redhat.com</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<div class="">For me it's working completelly fine:<br class="">
<br class="">
...<br class="">
config.mapUser.type = regex<br class="">
config.mapUser.regex.pattern = ^(?&lt;user&gt;[^@]*)$<br class="">
config.mapUser.regex.replacement = ${user}@<a href="http://domainx.com/" class="">DOMAINX.com</a><br class="">
config.mapUser.regex.mustMatch = false<br class="">
...<br class="">
<br class="">
$ ovirt-engine-extensions-tool aaa login-user --password=pass:password --user-name=user@DOMAINY --profile=ad<br class="">
<br class="">
INFO &nbsp;&nbsp;&nbsp;API: --&gt;Mapping.InvokeCommands.MAP_USER profile='ad' user='user@DOMAINY'<br class="">
INFO &nbsp;&nbsp;&nbsp;API: &lt;--Mapping.InvokeCommands.MAP_USER profile='ad' user='user@DOMAINY'<br class="">
<br class="">
$ ovirt-engine-extensions-tool aaa login-user --password=pass:password --user-name=user --profile=ad<br class="">
<br class="">
INFO &nbsp;&nbsp;&nbsp;API: --&gt;Mapping.InvokeCommands.MAP_USER profile='ad' user='user'<br class="">
INFO &nbsp;&nbsp;&nbsp;API: &lt;--Mapping.InvokeCommands.MAP_USER profile='ad' <a href="mailto:user='user@DOMAINX.com" class="">
user='user@DOMAINX.com</a>'<br class="">
<br class="">
As you can see it's correctly mapped.<br class="">
<br class="">
Please check once again the regex is correct, if it still won't work, please send log output again.<br class="">
</div>
</blockquote>
<div class=""><br class="">
</div>
<span class="">
<div class="">/etc/ovirt-engine/extensions.d/mapping-suffix.properties:</div>
</span><span class="">ovirt.engine.extension.name = mapping-suffix<br class="">
ovirt.engine.extension.bindings.method = jbossmodule<br class="">
ovirt.engine.extension.binding.jbossmodule.module = org.ovirt.engine-extensions.aaa.misc<br class="">
ovirt.engine.extension.binding.jbossmodule.class =&nbsp;org.ovirt.engineextensions.aaa.misc.mapping.MappingExtension<br class="">
ovirt.engine.extension.provides = org.ovirt.engine.api.extensions.aaa.Mapping<br class="">
config.mapUser.type = regex<br class="">
config.mapUser.regex.pattern = ^(?&lt;user&gt;[^@]*)$<br class="">
config.mapUser.regex.replacement = ${user}@foo.bar<br class="">
config.mapUser.regex.mustMatch = false</span></div>
<div class=""><span class=""><br class="">
</span></div>
<span class=""># ovirt-engine-extensions-tool --log-level=FINEST aaa login-user --profile=baz.foo.bar-new --<a href="mailto:user-name=user@baz.foo.bar" class="">user-name=user@baz.foo.bar</a><br class="">
# grep Mapping.InvokeCommands.MAP_USER login.log&nbsp;<br class="">
2016-03-26 13:27:40 INFO&nbsp; &nbsp;&nbsp;API: --&gt;Mapping.InvokeCommands.MAP_USER&nbsp;<a href="mailto:user='user@baz.foo.bar" class="">user='user@baz.foo.bar</a>'<br class="">
2016-03-26 13:27:40 INFO&nbsp; &nbsp; API: &lt;--Mapping.InvokeCommands.MAP_USER&nbsp;<a href="mailto:user='user@baz.foo.bar" class="">user='user@baz.foo.bar</a>'<br class="">
</span><span class=""><br class="">
</span>
<div class=""><span class="">And here is the log:</span></div>
<div class=""><span class=""><a href="https://dropoff.slu.se/index.php/s/SK9T8vOUO7yB3PM/download" class="">https://dropoff.slu.se/index.php/s/SK9T8vOUO7yB3PM/download</a></span></div>
<div class=""><span class=""><br class="">
</span></div>
<div class=""><span class="">/K</span></div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
Eureka! I changed ‘vars.user’ in ‘baz.foo.bar-new.properties’ from one with suffix ‘@baz.foo.bar’ to mine that has a ‘@foo.bar’ ending and now it works, for some reason. Very strange, but anyway... How do I go about changing from UPN to samAccountName, if I´d
 want that instead?</div>
<div><br class="">
</div>
<div>/K</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class=""><span class=""><br class="">
</span>
<blockquote type="cite" class="">
<div class=""><br class="">
On 03/26/2016 10:07 AM, Karli Sjöberg wrote:<br class="">
<blockquote type="cite" class="">What the heck, my message disappeares! Trying again.<br class="">
<br class="">
Ok, so it's mapping now but the only thing working is:<br class="">
config.mapUser.regex.pattern = <a href="mailto:user@baz.foo.bar" class="">user@baz.foo.bar</a><br class="">
config.mapUser.regex.replacement = <a href="mailto:user@foo.bar" class="">user@foo.bar</a><br class="">
<br class="">
And that isn't very useful. Please advice!<br class="">
<br class="">
/K<br class="">
<br class="">
On 03/25/2016 12:26 AM, Karli Sjöberg wrote:<br class="">
<blockquote type="cite" class=""><br class="">
Den 25 mars 2016 12:10 fm skrev Karli Sjöberg &lt;<a href="mailto:karli.sjoberg@slu.se" class="">karli.sjoberg@slu.se</a>&gt;:<br class="">
&nbsp;&gt;<br class="">
&nbsp;&gt;<br class="">
&nbsp;&gt; Den 24 mars 2016 11:26 em skrev Ondra Machacek &lt;<a href="mailto:omachace@redhat.com" class="">omachace@redhat.com</a>&gt;:<br class="">
&nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; On 03/24/2016 11:14 PM, Karli Sjöberg wrote:<br class="">
&nbsp;&gt; &gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; Den 24 mars 2016 7:26 em skrev Ondra Machacek &lt;<a href="mailto:omachace@redhat.com" class="">omachace@redhat.com</a>&gt;:<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; On 03/24/2016 06:16 PM, Karli Sjöberg wrote:<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; Hi!<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; Starting new thread instead of jacking someone else´s.<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; Managed to migrate from old 'engine-manage-domains' auth to<br class="">
&nbsp;&gt; &gt; &gt; aaa-ldap using:<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; #| ovirt-engine-kerbldap-migration-tool --domain baz.foo.bar<br class="">
--cacert<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; /tmp/ca.crt --apply<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; |<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; All OK, no errors, but cannot log in:<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; # ovirt-engine-extensions-tool aaa login-user<br class="">
--profile=baz.foo.bar-new<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; --user-name=user:<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; If you want to login with user with different upn suffix, then<br class="">
just<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; append that suffix<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; $ ovirt-engine-extensions-tool aaa login-user<br class="">
--profile=baz.foo.bar-new<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; --<a href="mailto:user-name=user@foo.bar" class="">user-name=user@foo.bar</a><br class="">
&nbsp;&gt; &gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; OK, some progress, that works!<br class="">
&nbsp;&gt; &gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; If you have more suffixes and want to have some as default you<br class="">
can use<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; following approach:<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; 1) install ovirt-engine-extension-aaa-misc<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; 2) create new mapping extension like this:<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; /etc/ovirt-engine/extensions.d/mapping-suffix.properties<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; ovirt.engine.extension.name = mapping-suffix<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; ovirt.engine.extension.bindings.method = jbossmodule<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; ovirt.engine.extension.binding.jbossmodule.module =<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; org.ovirt.engine-extensions.aaa.misc<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; ovirt.engine.extension.binding.jbossmodule.class =<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; org.ovirt.engineextensions.aaa.misc.mapping.MappingExtension<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; ovirt.engine.extension.provides =<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; org.ovirt.engine.api.extensions.aaa.Mapping<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; config.mapUser.type = regex<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; config.mapUser.pattern = ^(?&lt;user&gt;[^@]*)$<br class="">
&nbsp;&gt; &gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; Is that supposed to really say '&lt;user&gt;' or should it be changed to a<br class="">
&nbsp;&gt; &gt; &gt; real user name? Either way, it doesn't work, I tried it all.<br class="">
&nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; '?&lt;user&gt;' is just a named group in that regex so you can later use<br class="">
it in<br class="">
&nbsp;&gt; &gt; 'config.mapUser.replacement' &nbsp;option. It should take everything until<br class="">
&nbsp;&gt; &gt; first '@'.<br class="">
&nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; config.mapUser.replacement = ${user}@foo.bar<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; config.mapUser.mustMatch = false<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; 3) select a mapping plugin in authn configuration:<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; ovirt.engine.aaa.authn.mapping.plugin = mapping-suffix<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; With above configuration in use, your user 'user' witll be<br class="">
mapped to<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; user '<a href="mailto:user@foo.bar" class="">user@foo.bar</a>'<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; and users '<a href="mailto:user@anotherdomain.foo.bar" class="">user@anotherdomain.foo.bar</a>' will remain<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; '<a href="mailto:user@anotherdomain.foo.bar" class="">user@anotherdomain.foo.bar</a>'.<br class="">
&nbsp;&gt; &gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; This however does not, it doesn't replace the suffix as it's supposed<br class="">
&nbsp;&gt; &gt; &gt; to. I tried with many different types of the 'mapUser.pattern' but it<br class="">
&nbsp;&gt; &gt; &gt; simply won't change it, even if I type in '= ^<a href="mailto:user@baz.foo.bar" class="">user@baz.foo.bar</a>$', the<br class="">
&nbsp;&gt; &gt; &gt; error is the same:(<br class="">
&nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; Hmm, hard to say what's wrong, try to run:<br class="">
&nbsp;&gt; &gt; $ ovirt-engine-extensions-tool --log-level=FINEST aaa login-user<br class="">
&nbsp;&gt; &gt; --profile=baz.foo.bar-new --user-name=user<br class="">
&nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; and search for a mapping part in log.<br class="">
&nbsp;&gt;<br class="">
&nbsp;&gt; Wow what a mouthfull:) Can you make anything out of it?<br class="">
&nbsp;&gt;<br class="">
&nbsp;&gt; <a href="https://dropoff.slu.se/index.php/s/EMe2NPmOfsWCNTv/download" class="">
https://dropoff.slu.se/index.php/s/EMe2NPmOfsWCNTv/download</a><br class="">
&nbsp;&gt;<br class="">
&nbsp;&gt; /K<br class="">
<br class="">
Just noticed after logging in to webadmin as &quot;<a href="mailto:user@foo.bar" class="">user@foo.bar</a>&quot; (which<br class="">
worked btw, so good there) that the &quot;User Name&quot; in Users main tab looks<br class="">
really odd:<br class="">
<a href="mailto:user@foo.bar" class="">user@foo.bar</a>@baz.foo.bar-new-authz<br class="">
</blockquote>
<br class="">
Sorry you are right, it don't work. I've sent you incorrect<br class="">
cofiguration, &nbsp;the correct one is:<br class="">
<br class="">
/etc/ovirt-engine/extensions.d/mapping-suffix.properties<br class="">
<br class="">
...<br class="">
config.mapUser.regex.pattern = ^(?&lt;user&gt;[^@]*)$<br class="">
config.mapUser.regex.replacement = ${user}@foo.bar<br class="">
config.mapUser.regex.mustMatch = false<br class="">
...<br class="">
<br class="">
Notice there was missing 'regex', after 'mapUser'.<br class="">
<br class="">
<blockquote type="cite" class=""><br class="">
/K<br class="">
<br class="">
&nbsp;&gt;<br class="">
&nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; /K<br class="">
&nbsp;&gt; &gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; API: &lt;--Authn.InvokeCommands.AUTHENTICATE_CREDENTIALS<br class="">
result=SUCCESS<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; but:<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; API: --&gt;Authz.InvokeCommands.FETCH_PRINCIPAL_RECORD<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; <a href="mailto:principal='user@baz.foo.bar" class="">principal='user@baz.foo.bar</a>'<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; SEVERE &nbsp;Cannot resolve principal '<a href="mailto:user@baz.foo.bar" class="">user@baz.foo.bar</a>'<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; So it fails.<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; # ldapsearch -x -H <a href="ldap://baz.foo.bar" class="">ldap://baz.foo.bar</a> -D
<a href="mailto:user@foo.bar" class="">user@foo.bar</a> -W -b<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; DC=baz,DC=foo,DC=bar -s sub &quot;(samAccountName=user)&quot;<br class="">
userPrincipalName |<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; grep 'userPrincipalName:'<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; userPrincipalName: <a href="mailto:user@foo.bar" class="">user@foo.bar</a><br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; |How do you configure AAA with base 'DC=baz,DC=foo,DC=bar' when<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; userPrincipalName ends only on '@foo.bar'?<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; /K<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; |<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; _______________________________________________<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; Users mailing list<br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; <a href="mailto:Users@ovirt.org" class="">Users@ovirt.org</a><br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt; <a href="http://lists.ovirt.org/mailman/listinfo/users" class="">http://lists.ovirt.org/mailman/listinfo/users</a><br class="">
&nbsp;&gt; &gt; &gt; &nbsp;&gt; &gt;<br class="">
&nbsp;&gt; &gt; &gt;<br class="">
<br class="">
</blockquote>
</blockquote>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</body>
</html>