<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p dir="ltr"><br>
Den 25 mars 2016 12:10 fm skrev Karli Sjöberg &lt;karli.sjoberg@slu.se&gt;:<br>
&gt;<br>
&gt;<br>
&gt; Den 24 mars 2016 11:26 em skrev Ondra Machacek &lt;omachace@redhat.com&gt;:<br>
&gt; &gt;<br>
&gt; &gt; On 03/24/2016 11:14 PM, Karli Sjöberg wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Den 24 mars 2016 7:26 em skrev Ondra Machacek &lt;omachace@redhat.com&gt;:<br>
&gt; &gt; &gt;&nbsp; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; On 03/24/2016 06:16 PM, Karli Sjöberg wrote:<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; Hi!<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; Starting new thread instead of jacking someone else´s.<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; Managed to migrate from old 'engine-manage-domains' auth to<br>
&gt; &gt; &gt; aaa-ldap using:<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; #| ovirt-engine-kerbldap-migration-tool --domain baz.foo.bar --cacert<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; /tmp/ca.crt --apply<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; |<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; All OK, no errors, but cannot log in:<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; # ovirt-engine-extensions-tool aaa login-user --profile=baz.foo.bar-new<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; --user-name=user:<br>
&gt; &gt; &gt;&nbsp; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; If you want to login with user with different upn suffix, then just<br>
&gt; &gt; &gt;&nbsp; &gt; append that suffix<br>
&gt; &gt; &gt;&nbsp; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; $ ovirt-engine-extensions-tool aaa login-user --profile=baz.foo.bar-new<br>
&gt; &gt; &gt;&nbsp; &gt; --user-name=user@foo.bar<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; OK, some progress, that works!<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; If you have more suffixes and want to have some as default you can use<br>
&gt; &gt; &gt;&nbsp; &gt; following approach:<br>
&gt; &gt; &gt;&nbsp; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; 1) install ovirt-engine-extension-aaa-misc<br>
&gt; &gt; &gt;&nbsp; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; 2) create new mapping extension like this:<br>
&gt; &gt; &gt;&nbsp; &gt; /etc/ovirt-engine/extensions.d/mapping-suffix.properties<br>
&gt; &gt; &gt;&nbsp; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; ovirt.engine.extension.name = mapping-suffix<br>
&gt; &gt; &gt;&nbsp; &gt; ovirt.engine.extension.bindings.method = jbossmodule<br>
&gt; &gt; &gt;&nbsp; &gt; ovirt.engine.extension.binding.jbossmodule.module =<br>
&gt; &gt; &gt;&nbsp; &gt; org.ovirt.engine-extensions.aaa.misc<br>
&gt; &gt; &gt;&nbsp; &gt; ovirt.engine.extension.binding.jbossmodule.class =<br>
&gt; &gt; &gt;&nbsp; &gt; org.ovirt.engineextensions.aaa.misc.mapping.MappingExtension<br>
&gt; &gt; &gt;&nbsp; &gt; ovirt.engine.extension.provides =<br>
&gt; &gt; &gt;&nbsp; &gt; org.ovirt.engine.api.extensions.aaa.Mapping<br>
&gt; &gt; &gt;&nbsp; &gt; config.mapUser.type = regex<br>
&gt; &gt; &gt;&nbsp; &gt; config.mapUser.pattern = ^(?&lt;user&gt;[^@]*)$<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Is that supposed to really say '&lt;user&gt;' or should it be changed to a<br>
&gt; &gt; &gt; real user name? Either way, it doesn't work, I tried it all.<br>
&gt; &gt;<br>
&gt; &gt; '?&lt;user&gt;' is just a named group in that regex so you can later use it in<br>
&gt; &gt; 'config.mapUser.replacement'&nbsp; option. It should take everything until <br>
&gt; &gt; first '@'.<br>
&gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; config.mapUser.replacement = ${user}@foo.bar<br>
&gt; &gt; &gt;&nbsp; &gt; config.mapUser.mustMatch = false<br>
&gt; &gt; &gt;&nbsp; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; 3) select a mapping plugin in authn configuration:<br>
&gt; &gt; &gt;&nbsp; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; ovirt.engine.aaa.authn.mapping.plugin = mapping-suffix<br>
&gt; &gt; &gt;&nbsp; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; With above configuration in use, your user 'user' witll be mapped to<br>
&gt; &gt; &gt;&nbsp; &gt; user 'user@foo.bar'<br>
&gt; &gt; &gt;&nbsp; &gt; and users 'user@anotherdomain.foo.bar' will remain<br>
&gt; &gt; &gt;&nbsp; &gt; 'user@anotherdomain.foo.bar'.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; This however does not, it doesn't replace the suffix as it's supposed<br>
&gt; &gt; &gt; to. I tried with many different types of the 'mapUser.pattern' but it<br>
&gt; &gt; &gt; simply won't change it, even if I type in '= ^user@baz.foo.bar$', the<br>
&gt; &gt; &gt; error is the same:(<br>
&gt; &gt;<br>
&gt; &gt; Hmm, hard to say what's wrong, try to run:<br>
&gt; &gt; $ ovirt-engine-extensions-tool --log-level=FINEST aaa login-user <br>
&gt; &gt; --profile=baz.foo.bar-new --user-name=user<br>
&gt; &gt;<br>
&gt; &gt; and search for a mapping part in log.<br>
&gt;<br>
&gt; Wow what a mouthfull:) Can you make anything out of it?<br>
&gt;<br>
&gt; https://dropoff.slu.se/index.php/s/EMe2NPmOfsWCNTv/download<br>
&gt;<br>
&gt; /K</p>
<p dir="ltr">Just noticed after logging in to webadmin as &quot;user@foo.bar&quot; (which worked btw, so good there) that the &quot;User Name&quot; in Users main tab looks really odd:<br>
user@foo.bar@baz.foo.bar-new-authz</p>
<p dir="ltr">/K</p>
<p dir="ltr">&gt;<br>
&gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; /K<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; API: &lt;--Authn.InvokeCommands.AUTHENTICATE_CREDENTIALS result=SUCCESS<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; but:<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; API: --&gt;Authz.InvokeCommands.FETCH_PRINCIPAL_RECORD<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; principal='user@baz.foo.bar'<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; SEVERE&nbsp; Cannot resolve principal 'user@baz.foo.bar'<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; So it fails.<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; # ldapsearch -x -H ldap://baz.foo.bar -D user@foo.bar -W -b<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; DC=baz,DC=foo,DC=bar -s sub &quot;(samAccountName=user)&quot; userPrincipalName |<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; grep 'userPrincipalName:'<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; userPrincipalName: user@foo.bar<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; |How do you configure AAA with base 'DC=baz,DC=foo,DC=bar' when<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; userPrincipalName ends only on '@foo.bar'?<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; /K<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; |<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; Users mailing list<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; Users@ovirt.org<br>
&gt; &gt; &gt;&nbsp; &gt; &gt; http://lists.ovirt.org/mailman/listinfo/users<br>
&gt; &gt; &gt;&nbsp; &gt; &gt;<br>
&gt; &gt; &gt;<br>
</p>
</body>
</html>