You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2016/06/16 10:42:35 UTC

[44/50] [abbrv] isis git commit: ISIS-1441: removes AuthenticationManagerStandardForDfltRuntime, instead use AuthenticationManagerStandard.

ISIS-1441: removes AuthenticationManagerStandardForDfltRuntime, instead use AuthenticationManagerStandard.

The supporting classes move from isis-core-runtime to isis-core-metamodel.  Because the Authenticator subclasses relied on DeploymentType (only available in the isis-core-runtime), these instead depend on DeploymentCategory (in isis-core-metamodel).

This also includes a minor refactoring in the closeSession stuff... previously we called closeSession on AuthenticationManagerStandardForDfltRuntime, that in turn called IsisSessionFactory#closeSession() in order to clear the threadlocal holding the current session.  However, IsisSessionFactory is part of isis-core-runtime so this design doesn't work.  However, there is only one caller of closeSession, namely UserResourceServerside (the RO viewer).  The refactoring is therefore easy enough... just have UserResourceServerside make the call to IsisSessionFactory.


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/364e5b9b
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/364e5b9b
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/364e5b9b

Branch: refs/heads/master
Commit: 364e5b9b64d6e831fecaec559ef649029c746ede
Parents: 29f1e08
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Thu Jun 16 10:01:36 2016 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Thu Jun 16 10:01:36 2016 +0100

----------------------------------------------------------------------
 .../components/AuthenticationManagerNull.java   |   3 +-
 .../AuthorizationManagerAllowAll.java           |   3 +-
 .../authentication/AuthenticationManager.java   |   3 +-
 .../AuthenticationRequestExploration.java       |  51 ++++++++
 .../exploration/ExplorationAuthenticator.java   | 122 ++++++++++++++++++
 .../ExplorationAuthenticatorConstants.java      |  31 +++++
 .../exploration/ExplorationSession.java         |  61 +++++++++
 .../fixture/LogonFixtureAuthenticator.java      |  49 +++++++
 .../standard/AuthenticationManagerStandard.java |  15 +--
 .../authentication/standard/Authenticator.java  |   7 +-
 .../standard/AuthenticatorAbstract.java         |  35 +++--
 .../standard/AuthenticatorDefault.java          |  31 +++++
 .../authorization/AuthorizationManager.java     |   3 +-
 .../standard/AuthorizationManagerStandard.java  |   8 +-
 .../authorization/standard/Authorizor.java      |  13 +-
 .../standard/AuthorizorAbstract.java            |  47 -------
 .../AuthenticationRequestLogonFixture.java      |  45 +++++++
 ...enticationManagerStandardForDfltRuntime.java |  79 ------------
 ...StandardInstallerAbstractForDfltRuntime.java |  28 +++-
 .../AuthenticatorAbstractForDfltRuntime.java    |  49 -------
 .../AuthenticationRequestExploration.java       |  55 --------
 .../exploration/ExplorationAuthenticator.java   | 127 -------------------
 .../ExplorationAuthenticatorConstants.java      |  31 -----
 .../exploration/ExplorationSession.java         |  61 ---------
 .../fixture/LogonFixtureAuthenticator.java      |  54 --------
 .../AuthenticationRequestLogonFixture.java      |  45 -------
 .../session/IsisSessionFactoryBuilder.java      |   4 +-
 ...AuthenticatorAbstractForDfltRuntimeTest.java | 126 ------------------
 .../standard/AuthenticatorDefaultTest.java      |  76 +++++++++++
 .../shiro/ShiroAuthenticatorOrAuthorizor.java   |  11 +-
 ...henticatorOrAuthorizorTest_authenticate.java |  28 ++--
 ...atorOrAuthorizorTest_isVisibleInAnyRole.java |  22 ++--
 .../authorization/AuthorizorBypass.java         |   3 +-
 .../resources/UserResourceServerside.java       |   6 +-
 34 files changed, 591 insertions(+), 741 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/components/AuthenticationManagerNull.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/components/AuthenticationManagerNull.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/components/AuthenticationManagerNull.java
index 3850500..6518012 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/components/AuthenticationManagerNull.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/components/AuthenticationManagerNull.java
@@ -21,6 +21,7 @@ package org.apache.isis.core.integtestsupport.components;
 
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.components.Noop;
+import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
 import org.apache.isis.core.runtime.authentication.AuthenticationManager;
 import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
 import org.apache.isis.core.runtime.authentication.RegistrationDetails;
@@ -28,7 +29,7 @@ import org.apache.isis.core.runtime.authentication.RegistrationDetails;
 public class AuthenticationManagerNull implements AuthenticationManager, Noop {
 
     @Override
-    public void init() {
+    public void init(final DeploymentCategory deploymentCategory) {
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/components/AuthorizationManagerAllowAll.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/components/AuthorizationManagerAllowAll.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/components/AuthorizationManagerAllowAll.java
index 03c9e70..cde743f 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/components/AuthorizationManagerAllowAll.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/components/AuthorizationManagerAllowAll.java
@@ -22,12 +22,13 @@ package org.apache.isis.core.integtestsupport.components;
 import org.apache.isis.applib.Identifier;
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
 import org.apache.isis.core.runtime.authorization.AuthorizationManager;
 
 public class AuthorizationManagerAllowAll implements AuthorizationManager {
 
     @Override
-    public void init() {
+    public void init(final DeploymentCategory deploymentCategory) {
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticationManager.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticationManager.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticationManager.java
index 11de514..b509f58 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticationManager.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticationManager.java
@@ -22,6 +22,7 @@ package org.apache.isis.core.runtime.authentication;
 import org.apache.isis.applib.annotation.Programmatic;
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.components.ApplicationScopedComponent;
+import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
 import org.apache.isis.core.metamodel.services.ServicesInjector;
 
 /**
@@ -31,7 +32,7 @@ import org.apache.isis.core.metamodel.services.ServicesInjector;
 public interface AuthenticationManager extends ApplicationScopedComponent {
 
     @Programmatic
-    void init();
+    void init(final DeploymentCategory deploymentCategory);
 
     @Programmatic
     void shutdown();

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/exploration/AuthenticationRequestExploration.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/exploration/AuthenticationRequestExploration.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/exploration/AuthenticationRequestExploration.java
new file mode 100644
index 0000000..53eb78b
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/exploration/AuthenticationRequestExploration.java
@@ -0,0 +1,51 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.runtime.authentication.exploration;
+
+import java.util.List;
+
+import org.apache.isis.applib.fixtures.LogonFixture;
+import org.apache.isis.core.runtime.authentication.AuthenticationRequestAbstract;
+
+public class AuthenticationRequestExploration extends AuthenticationRequestAbstract {
+
+    private static final String EXPLORATION_USER = "exploration";
+
+    private final LogonFixture logonFixture;
+
+    public AuthenticationRequestExploration() {
+        this(null);
+    }
+
+    public AuthenticationRequestExploration(final LogonFixture logonFixture) {
+        super(logonFixture != null ? logonFixture.getUsername() : EXPLORATION_USER);
+        this.logonFixture = logonFixture;
+    }
+
+    @Override
+    public List<String> getRoles() {
+        return logonFixture != null ? logonFixture.getRoles() : super.getRoles();
+    }
+
+    public boolean isDefaultUser() {
+        return EXPLORATION_USER.equals(getName());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationAuthenticator.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationAuthenticator.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationAuthenticator.java
new file mode 100644
index 0000000..0732e17
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationAuthenticator.java
@@ -0,0 +1,122 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.runtime.authentication.exploration;
+
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.apache.isis.core.commons.authentication.AuthenticationSession;
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
+import org.apache.isis.core.runtime.authentication.standard.AuthenticatorAbstract;
+import org.apache.isis.core.runtime.authentication.standard.SimpleSession;
+
+/**
+ * Creates a session suitable for {@link org.apache.isis.core.metamodel.deployment.DeploymentCategory#PROTOTYPING}
+ * mode.
+ * 
+ * <p>
+ * The format of the {@value ExplorationAuthenticatorConstants#USERS} key should
+ * be:
+ * 
+ * <pre>
+ * &lt;:userName&gt; [:&lt;role&gt;[|&lt;role&gt;]...], &lt;userName&gt;...
+ * </pre>
+ */
+public class ExplorationAuthenticator extends AuthenticatorAbstract {
+
+    //region > Constructor, fields
+    private final Set<SimpleSession> registeredSessions = new LinkedHashSet<SimpleSession>();;
+    private final String users;
+
+
+    public ExplorationAuthenticator(final IsisConfiguration configuration) {
+        super(configuration);
+        users = getConfiguration().getString(ExplorationAuthenticatorConstants.USERS);
+        if (users != null) {
+            registeredSessions.addAll(parseUsers(users));
+        }
+    }
+
+    //endregion
+
+    private List<SimpleSession> parseUsers(final String users) {
+        final List<SimpleSession> registeredUsers = new ArrayList<SimpleSession>();
+
+        final StringTokenizer st = new StringTokenizer(users, ",");
+        while (st.hasMoreTokens()) {
+            final String token = st.nextToken();
+            final int end = token.indexOf(':');
+            final List<String> roles = new ArrayList<String>();
+            final String userName;
+            if (end == -1) {
+                userName = token.trim();
+            } else {
+                userName = token.substring(0, end).trim();
+                final String roleList = token.substring(end + 1);
+                final StringTokenizer st2 = new StringTokenizer(roleList, "|");
+                while (st2.hasMoreTokens()) {
+                    final String role = st2.nextToken().trim();
+                    roles.add(role);
+                }
+            }
+            registeredUsers.add(createSimpleSession(userName, roles));
+        }
+        return registeredUsers;
+    }
+
+    private SimpleSession createSimpleSession(final String userName, final List<String> roles) {
+        return new SimpleSession(userName, roles.toArray(new String[roles.size()]));
+    }
+
+    // //////////////////////////////////////////////////////////////////
+    // API
+    // //////////////////////////////////////////////////////////////////
+
+    /**
+     * Can authenticate if a {@link AuthenticationRequestExploration}.
+     */
+    @Override
+    public final boolean canAuthenticate(final Class<? extends AuthenticationRequest> authenticationRequestClass) {
+        return AuthenticationRequestExploration.class.isAssignableFrom(authenticationRequestClass);
+    }
+
+    @Override
+    protected final boolean isValid(final AuthenticationRequest request) {
+        return getDeploymentCategory().isExploring();
+    }
+
+    @Override
+    public AuthenticationSession authenticate(final AuthenticationRequest request, final String code) {
+        final AuthenticationRequestExploration authenticationRequestExploration = (AuthenticationRequestExploration) request;
+        if (!authenticationRequestExploration.isDefaultUser()) {
+            registeredSessions.add(createSimpleSession(authenticationRequestExploration.getName(), authenticationRequestExploration.getRoles()));
+        }
+        if (registeredSessions.size() >= 1) {
+            return registeredSessions.iterator().next();
+        } else {
+            return new ExplorationSession(code);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationAuthenticatorConstants.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationAuthenticatorConstants.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationAuthenticatorConstants.java
new file mode 100644
index 0000000..36c2c16
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationAuthenticatorConstants.java
@@ -0,0 +1,31 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.runtime.authentication.exploration;
+
+import org.apache.isis.core.commons.config.ConfigurationConstants;
+
+public final class ExplorationAuthenticatorConstants {
+
+    public static final String USERS = ConfigurationConstants.ROOT + "exploration.users";
+
+    private ExplorationAuthenticatorConstants() {
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationSession.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationSession.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationSession.java
new file mode 100644
index 0000000..144a2b2
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationSession.java
@@ -0,0 +1,61 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.runtime.authentication.exploration;
+
+import java.io.IOException;
+
+import org.apache.isis.core.commons.authentication.AuthenticationSessionAbstract;
+import org.apache.isis.core.commons.encoding.DataInputExtended;
+import org.apache.isis.core.commons.encoding.DataOutputExtended;
+import org.apache.isis.core.commons.encoding.Encodable;
+
+public final class ExplorationSession extends AuthenticationSessionAbstract implements Encodable {
+
+    private static final long serialVersionUID = 1L;
+
+    private static final String DEFAULT_USER_NAME = "exploration";
+
+    /**
+     * Defaults validation code to <tt>""</tt>.
+     */
+    public ExplorationSession() {
+        this("");
+    }
+
+    public ExplorationSession(final String code) {
+        super(DEFAULT_USER_NAME, code);
+        initialized();
+    }
+
+    public ExplorationSession(final DataInputExtended input) throws IOException {
+        super(input);
+        initialized();
+    }
+
+    @Override
+    public void encode(final DataOutputExtended output) throws IOException {
+        super.encode(output);
+    }
+
+    private void initialized() {
+        // nothing to do
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/fixture/LogonFixtureAuthenticator.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/fixture/LogonFixtureAuthenticator.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/fixture/LogonFixtureAuthenticator.java
new file mode 100644
index 0000000..aec2356
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/fixture/LogonFixtureAuthenticator.java
@@ -0,0 +1,49 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.runtime.authentication.fixture;
+
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
+import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
+import org.apache.isis.core.runtime.authentication.standard.AuthenticatorAbstract;
+import org.apache.isis.core.runtime.fixtures.authentication.AuthenticationRequestLogonFixture;
+
+public class LogonFixtureAuthenticator extends AuthenticatorAbstract {
+
+    public LogonFixtureAuthenticator(final IsisConfiguration configuration) {
+        super(configuration);
+    }
+
+    /**
+     * Can authenticate if a {@link AuthenticationRequestLogonFixture}.
+     */
+    @Override
+    public final boolean canAuthenticate(final Class<? extends AuthenticationRequest> authenticationRequestClass) {
+        return AuthenticationRequestLogonFixture.class.isAssignableFrom(authenticationRequestClass);
+    }
+
+    @Override
+    protected final boolean isValid(final AuthenticationRequest request) {
+        final DeploymentCategory deploymentCategory = getDeploymentCategory();
+        return deploymentCategory.isExploring() || deploymentCategory.isPrototyping();
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/AuthenticationManagerStandard.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/AuthenticationManagerStandard.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/AuthenticationManagerStandard.java
index d64fba5..fac9953 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/AuthenticationManagerStandard.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/AuthenticationManagerStandard.java
@@ -33,6 +33,7 @@ import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.commons.util.ToString;
+import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
 import org.apache.isis.core.runtime.authentication.AuthenticationManager;
 import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
 import org.apache.isis.core.runtime.authentication.RegistrationDetails;
@@ -41,11 +42,7 @@ public class AuthenticationManagerStandard implements AuthenticationManager {
 
     private final Map<String, String> userByValidationCode = Maps.newHashMap();
 
-    /**
-     * Not final because may be set {@link #setAuthenticators(List)
-     * programmatically}.
-     */
-    private List<Authenticator> authenticators = Lists.newArrayList();
+    private final List<Authenticator> authenticators = Lists.newArrayList();
 
     private RandomCodeGenerator randomCodeGenerator;
     private final IsisConfiguration configuration;
@@ -62,16 +59,17 @@ public class AuthenticationManagerStandard implements AuthenticationManager {
      * Will default the {@link #setRandomCodeGenerator(RandomCodeGenerator)
      * RandomCodeGenerator}, but {@link Authenticator}(s) must have been
      * {@link #addAuthenticator(Authenticator) added}.
+     * @param deploymentCategory
      */
     @Programmatic
-    public final void init() {
+    public final void init(final DeploymentCategory deploymentCategory) {
         defaultRandomCodeGeneratorIfNecessary();
         addDefaultAuthenticators();
         if (authenticators.size() == 0) {
             throw new IsisException("No authenticators specified");
         }
         for (final Authenticator authenticator : authenticators) {
-            authenticator.init();
+            authenticator.init(deploymentCategory);
         }
     }
 
@@ -150,7 +148,8 @@ public class AuthenticationManagerStandard implements AuthenticationManager {
         authenticators.add(authenticator);
     }
 
-    protected void addAuthenticatorToStart(final Authenticator authenticator) {
+    @Programmatic
+    public void addAuthenticatorToStart(final Authenticator authenticator) {
         authenticators.add(0, authenticator);
     }
 

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/Authenticator.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/Authenticator.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/Authenticator.java
index 50bd29d..a9e113d 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/Authenticator.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/Authenticator.java
@@ -21,12 +21,15 @@ package org.apache.isis.core.runtime.authentication.standard;
 
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.components.ApplicationScopedComponent;
+import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
 import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
 
 public interface Authenticator extends ApplicationScopedComponent {
 
-    public void init();
-    public void shutdown();
+    void init(final DeploymentCategory deploymentCategory);
+    void shutdown();
+
+    DeploymentCategory getDeploymentCategory();
 
     /**
      * Whether the provided {@link AuthenticationRequest} is recognized by this

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/AuthenticatorAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/AuthenticatorAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/AuthenticatorAbstract.java
index 96e819b..5268472 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/AuthenticatorAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/AuthenticatorAbstract.java
@@ -21,27 +21,27 @@ package org.apache.isis.core.runtime.authentication.standard;
 
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
 import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
 
 public abstract class AuthenticatorAbstract implements Authenticator {
 
+    //region > constructor, fields
     private final IsisConfiguration configuration;
-
-    // //////////////////////////////////////////////////////
-    // constructor
-    // //////////////////////////////////////////////////////
+    private DeploymentCategory deploymentCategory;
 
     public AuthenticatorAbstract(final IsisConfiguration configuration) {
         this.configuration = configuration;
     }
 
-    // //////////////////////////////////////////////////////
-    // init, shutdown
-    // //////////////////////////////////////////////////////
+    //endregion
+
+    //region > init, shutdown
 
     @Override
-    public void init() {
+    public void init(final DeploymentCategory deploymentCategory) {
         // does nothing.
+        this.deploymentCategory = deploymentCategory;
     }
 
     @Override
@@ -49,9 +49,14 @@ public abstract class AuthenticatorAbstract implements Authenticator {
         // does nothing.
     }
 
-    // //////////////////////////////////////////////////////
-    // API
-    // //////////////////////////////////////////////////////
+    @Override
+    public DeploymentCategory getDeploymentCategory() {
+        return deploymentCategory;
+    }
+
+    //endregion
+
+    //region > API
 
     /**
      * Default implementation returns a {@link SimpleSession}; can be overridden
@@ -80,12 +85,14 @@ public abstract class AuthenticatorAbstract implements Authenticator {
      */
     protected abstract boolean isValid(AuthenticationRequest request);
 
-    // //////////////////////////////////////////////////////
-    // Injected (via constructor)
-    // //////////////////////////////////////////////////////
+    //endregion
+
+    //region > Injected (via constructor)
 
     public IsisConfiguration getConfiguration() {
         return configuration;
     }
 
+    //endregion
+
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/AuthenticatorDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/AuthenticatorDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/AuthenticatorDefault.java
new file mode 100644
index 0000000..3804e7e
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authentication/standard/AuthenticatorDefault.java
@@ -0,0 +1,31 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.runtime.authentication.standard;
+
+import org.apache.isis.core.commons.config.IsisConfiguration;
+
+public abstract class AuthenticatorDefault extends AuthenticatorAbstract {
+
+    public AuthenticatorDefault(final IsisConfiguration configuration) {
+        super(configuration);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/AuthorizationManager.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/AuthorizationManager.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/AuthorizationManager.java
index e43aba6..832ad03 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/AuthorizationManager.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/AuthorizationManager.java
@@ -24,6 +24,7 @@ import org.apache.isis.applib.annotation.Programmatic;
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.components.ApplicationScopedComponent;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
 import org.apache.isis.core.metamodel.services.ServicesInjector;
 
 /**
@@ -35,7 +36,7 @@ import org.apache.isis.core.metamodel.services.ServicesInjector;
 public interface AuthorizationManager extends ApplicationScopedComponent {
 
     @Programmatic
-    void init();
+    void init(final DeploymentCategory deploymentCategory);
 
     @Programmatic
     void shutdown();

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/standard/AuthorizationManagerStandard.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/standard/AuthorizationManagerStandard.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/standard/AuthorizationManagerStandard.java
index ee3a055..276427b 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/standard/AuthorizationManagerStandard.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/standard/AuthorizationManagerStandard.java
@@ -20,10 +20,10 @@
 package org.apache.isis.core.runtime.authorization.standard;
 
 import org.apache.isis.applib.Identifier;
-import org.apache.isis.applib.annotation.Programmatic;
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
 import org.apache.isis.core.metamodel.progmodel.ProgrammingModel;
 import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorComposite;
 import org.apache.isis.core.runtime.authorization.AuthorizationManagerAbstract;
@@ -42,7 +42,7 @@ public class AuthorizationManagerStandard extends AuthorizationManagerAbstract {
         authorizor = new Authorizor() {
 
             @Override
-            public void init() {
+            public void init(final DeploymentCategory deploymentCategory) {
             }
 
             @Override
@@ -75,8 +75,8 @@ public class AuthorizationManagerStandard extends AuthorizationManagerAbstract {
     // init, shutddown
     // /////////////////////////////////////////////////////////
 
-    public void init() {
-        authorizor.init();
+    public void init(final DeploymentCategory deploymentCategory) {
+        authorizor.init(deploymentCategory);
     }
 
     public void shutdown() {

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/standard/Authorizor.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/standard/Authorizor.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/standard/Authorizor.java
index a60e214..5d1616f 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/standard/Authorizor.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/standard/Authorizor.java
@@ -21,24 +21,25 @@ package org.apache.isis.core.runtime.authorization.standard;
 
 import org.apache.isis.applib.Identifier;
 import org.apache.isis.core.commons.components.ApplicationScopedComponent;
+import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
 
 public interface Authorizor extends ApplicationScopedComponent {
 
-    public void init();
-    public void shutdown();
+    void init(final DeploymentCategory deploymentCategory);
+    void shutdown();
 
-    public boolean isVisibleInAnyRole(final Identifier identifier);
-    public boolean isUsableInAnyRole(final Identifier identifier);
+    boolean isVisibleInAnyRole(final Identifier identifier);
+    boolean isUsableInAnyRole(final Identifier identifier);
 
     /**
      * Checked for each of the user's roles.
      */
-    public boolean isVisibleInRole(final String role, final Identifier identifier);
+    boolean isVisibleInRole(final String role, final Identifier identifier);
 
     /**
      * Checked for each of the user's roles.
      */
-    public boolean isUsableInRole(final String role, final Identifier identifier);
+    boolean isUsableInRole(final String role, final Identifier identifier);
 
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/standard/AuthorizorAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/standard/AuthorizorAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/standard/AuthorizorAbstract.java
deleted file mode 100644
index bd81027..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/runtime/authorization/standard/AuthorizorAbstract.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.runtime.authorization.standard;
-
-import org.apache.isis.applib.Identifier;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-
-public abstract class AuthorizorAbstract implements Authorizor {
-
-    private final IsisConfiguration configuration;
-
-    public AuthorizorAbstract(final IsisConfiguration configuration) {
-        this.configuration = configuration;
-    }
-
-    public IsisConfiguration getConfiguration() {
-        return configuration;
-    }
-
-    @Override
-    public boolean isVisibleInAnyRole(Identifier identifier) {
-        return false;
-    }
-
-    @Override
-    public boolean isUsableInAnyRole(Identifier identifier) {
-        return false;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/metamodel/src/main/java/org/apache/isis/core/runtime/fixtures/authentication/AuthenticationRequestLogonFixture.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/fixtures/authentication/AuthenticationRequestLogonFixture.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/fixtures/authentication/AuthenticationRequestLogonFixture.java
new file mode 100644
index 0000000..c3f52cc
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/runtime/fixtures/authentication/AuthenticationRequestLogonFixture.java
@@ -0,0 +1,45 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.runtime.fixtures.authentication;
+
+import java.util.List;
+
+import org.apache.isis.applib.fixtures.LogonFixture;
+import org.apache.isis.core.runtime.authentication.AuthenticationRequestAbstract;
+import org.apache.isis.core.runtime.authentication.standard.AuthenticationManagerStandard;
+
+/**
+ * For testing purposes, request corresponding to a {@link LogonFixture}.
+ * 
+ * <p>
+ * Understood directly by {@link AuthenticationManagerStandard}.
+ */
+public class AuthenticationRequestLogonFixture extends AuthenticationRequestAbstract {
+
+    public AuthenticationRequestLogonFixture(final LogonFixture logonFixture) {
+        this(logonFixture.getUsername(), logonFixture.getRoles());
+    }
+
+    public AuthenticationRequestLogonFixture(final String name, final List<String> roles) {
+        super(name);
+        setRoles(roles);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticationManagerStandardForDfltRuntime.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticationManagerStandardForDfltRuntime.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticationManagerStandardForDfltRuntime.java
deleted file mode 100644
index 04fe4eb..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticationManagerStandardForDfltRuntime.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.runtime.authentication;
-
-import javax.inject.Inject;
-
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.fixtures.LogonFixture;
-import org.apache.isis.core.commons.authentication.AuthenticationSession;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.runtime.authentication.exploration.ExplorationAuthenticator;
-import org.apache.isis.core.runtime.authentication.exploration.ExplorationSession;
-import org.apache.isis.core.runtime.authentication.fixture.LogonFixtureAuthenticator;
-import org.apache.isis.core.runtime.authentication.standard.AuthenticationManagerStandard;
-import org.apache.isis.core.runtime.system.DeploymentType;
-import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
-
-/**
- * A refinement of the {@link AuthenticationManagerStandard}, which adds support
- * to make it easier without the need of logging in when running in either
- * {@link DeploymentType#SERVER_EXPLORATION exploration} mode or in
- * {@link DeploymentType#SERVER_PROTOTYPE prototype} mode.
- * 
- * <p>
- * Specifically:
- * <ul>
- * <li>the {@link ExplorationAuthenticator} will always provide a special
- * {@link ExplorationSession} if running in the {@link DeploymentType} of
- * {@link DeploymentType#SERVER_EXPLORATION exploration}.
- * <li>the {@link LogonFixtureAuthenticator} will set up a session using the
- * login provided by a {@link LogonFixture}, provided that the
- * {@link DeploymentType} is {@link DeploymentType#SERVER_EXPLORATION exploration} or
- * {@link DeploymentType#SERVER_PROTOTYPE prototyping}
- * </ul>
- */
-public class AuthenticationManagerStandardForDfltRuntime extends AuthenticationManagerStandard {
-
-    public AuthenticationManagerStandardForDfltRuntime(final IsisConfiguration configuration) {
-        super(configuration);
-    }
-
-
-    @Programmatic
-    @Override
-    protected void addDefaultAuthenticators() {
-        // we add to start to ensure that these special case authenticators
-        // are always consulted first
-        addAuthenticatorToStart(new ExplorationAuthenticator(getConfiguration()));
-        addAuthenticatorToStart(new LogonFixtureAuthenticator(getConfiguration()));
-    }
-
-    @Programmatic
-    @Override
-    public void closeSession(final AuthenticationSession session) {
-        super.closeSession(session);
-        isisSessionFactory.closeSession();
-    }
-
-    @javax.inject.Inject
-    IsisSessionFactory isisSessionFactory;
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticationManagerStandardInstallerAbstractForDfltRuntime.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticationManagerStandardInstallerAbstractForDfltRuntime.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticationManagerStandardInstallerAbstractForDfltRuntime.java
index 8840218..1bc7486 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticationManagerStandardInstallerAbstractForDfltRuntime.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticationManagerStandardInstallerAbstractForDfltRuntime.java
@@ -19,7 +19,12 @@
 
 package org.apache.isis.core.runtime.authentication;
 
+import org.apache.isis.applib.fixtures.LogonFixture;
+import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.config.IsisConfigurationDefault;
+import org.apache.isis.core.runtime.authentication.exploration.ExplorationAuthenticator;
+import org.apache.isis.core.runtime.authentication.exploration.ExplorationSession;
+import org.apache.isis.core.runtime.authentication.fixture.LogonFixtureAuthenticator;
 import org.apache.isis.core.runtime.authentication.standard.AuthenticationManagerStandard;
 import org.apache.isis.core.runtime.authentication.standard.AuthenticationManagerStandardInstallerAbstract;
 
@@ -32,9 +37,30 @@ public abstract class AuthenticationManagerStandardInstallerAbstractForDfltRunti
         super(name, isisConfiguration);
     }
 
+    /**
+     * Returns an instance of {@link AuthenticationManagerStandard} that has no need to log in when running in
+     * exploration mode.
+     *
+     * <p>
+     * Specifically:
+     * <ul>
+     * <li> the {@link ExplorationAuthenticator} will always provide a special {@link ExplorationSession} if running
+     *      in the exploration mode.
+     * <li> the {@link LogonFixtureAuthenticator} will set up a session using the login provided by a
+     *      {@link LogonFixture}, provided running in exploration or prototyping mode.
+     * </ul>
+     */
     @Override
     protected AuthenticationManagerStandard createAuthenticationManagerStandard() {
-        return new AuthenticationManagerStandardForDfltRuntime(getConfiguration());
+        final IsisConfiguration configuration = getConfiguration();
+
+        final AuthenticationManagerStandard authenticationManager = new AuthenticationManagerStandard(configuration);
+
+        // we add to start to ensure that these special case authenticators are always consulted first
+        authenticationManager.addAuthenticatorToStart(new ExplorationAuthenticator(configuration));
+        authenticationManager.addAuthenticatorToStart(new LogonFixtureAuthenticator(configuration));
+
+        return authenticationManager;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticatorAbstractForDfltRuntime.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticatorAbstractForDfltRuntime.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticatorAbstractForDfltRuntime.java
deleted file mode 100644
index 40e8b2c..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/AuthenticatorAbstractForDfltRuntime.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.runtime.authentication;
-
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.runtime.authentication.standard.AuthenticatorAbstract;
-import org.apache.isis.core.runtime.system.DeploymentType;
-import org.apache.isis.core.runtime.system.SystemConstants;
-
-public abstract class AuthenticatorAbstractForDfltRuntime extends AuthenticatorAbstract {
-
-    public AuthenticatorAbstractForDfltRuntime(final IsisConfiguration configuration) {
-        super(configuration);
-    }
-
-    // //////////////////////////////////////////////////////
-    // Helpers
-    // //////////////////////////////////////////////////////
-
-    /**
-     * Helper method for convenience of implementations that depend on the
-     * {@link DeploymentType}.
-     */
-    public DeploymentType getDeploymentType() {
-        final String deploymentTypeStr = getConfiguration().getString(SystemConstants.DEPLOYMENT_TYPE_KEY);
-        if (deploymentTypeStr == null) {
-            throw new IllegalStateException("Expect value for '" + SystemConstants.DEPLOYMENT_TYPE_KEY + "' to be bound into IsisConfiguration");
-        }
-        return DeploymentType.lookup(deploymentTypeStr);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/exploration/AuthenticationRequestExploration.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/exploration/AuthenticationRequestExploration.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/exploration/AuthenticationRequestExploration.java
deleted file mode 100644
index 21ff2ea..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/exploration/AuthenticationRequestExploration.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.runtime.authentication.exploration;
-
-import java.util.List;
-
-import org.apache.isis.applib.fixtures.LogonFixture;
-import org.apache.isis.core.runtime.authentication.AuthenticationRequestAbstract;
-
-/**
- * For testing purposes, requests corresponding to an {@link ExplorationSession}
- * .
- */
-public class AuthenticationRequestExploration extends AuthenticationRequestAbstract {
-
-    private static final String EXPLORATION_USER = "exploration";
-
-    private final LogonFixture logonFixture;
-
-    public AuthenticationRequestExploration() {
-        this(null);
-    }
-
-    public AuthenticationRequestExploration(final LogonFixture logonFixture) {
-        super(logonFixture != null ? logonFixture.getUsername() : EXPLORATION_USER);
-        this.logonFixture = logonFixture;
-    }
-
-    @Override
-    public List<String> getRoles() {
-        return logonFixture != null ? logonFixture.getRoles() : super.getRoles();
-    }
-
-    public boolean isDefaultUser() {
-        return EXPLORATION_USER.equals(getName());
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationAuthenticator.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationAuthenticator.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationAuthenticator.java
deleted file mode 100644
index 32b65c5..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationAuthenticator.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.runtime.authentication.exploration;
-
-import java.util.ArrayList;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import org.apache.isis.core.commons.authentication.AuthenticationSession;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
-import org.apache.isis.core.runtime.authentication.AuthenticatorAbstractForDfltRuntime;
-import org.apache.isis.core.runtime.authentication.standard.SimpleSession;
-import org.apache.isis.core.runtime.system.DeploymentType;
-
-/**
- * Creates a session suitable for {@link DeploymentType#SERVER_EXPLORATION exploration}
- * mode.
- * 
- * <p>
- * The format of the {@value ExplorationAuthenticatorConstants#USERS} key should
- * be:
- * 
- * <pre>
- * &lt;:userName&gt; [:&lt;role&gt;[|&lt;role&gt;]...], &lt;userName&gt;...
- * </pre>
- */
-public class ExplorationAuthenticator extends AuthenticatorAbstractForDfltRuntime {
-
-    private final Set<SimpleSession> registeredSessions = new LinkedHashSet<SimpleSession>();;
-    private final String users;
-
-    // //////////////////////////////////////////////////////////////////
-    // Constructor
-    // //////////////////////////////////////////////////////////////////
-
-    public ExplorationAuthenticator(final IsisConfiguration configuration) {
-        super(configuration);
-        users = getConfiguration().getString(ExplorationAuthenticatorConstants.USERS);
-        if (users != null) {
-            registeredSessions.addAll(parseUsers(users));
-        }
-    }
-
-    private List<SimpleSession> parseUsers(final String users) {
-        final List<SimpleSession> registeredUsers = new ArrayList<SimpleSession>();
-
-        final StringTokenizer st = new StringTokenizer(users, ",");
-        while (st.hasMoreTokens()) {
-            final String token = st.nextToken();
-            final int end = token.indexOf(':');
-            final List<String> roles = new ArrayList<String>();
-            final String userName;
-            if (end == -1) {
-                userName = token.trim();
-            } else {
-                userName = token.substring(0, end).trim();
-                final String roleList = token.substring(end + 1);
-                final StringTokenizer st2 = new StringTokenizer(roleList, "|");
-                while (st2.hasMoreTokens()) {
-                    final String role = st2.nextToken().trim();
-                    roles.add(role);
-                }
-            }
-            registeredUsers.add(createSimpleSession(userName, roles));
-        }
-        return registeredUsers;
-    }
-
-    private SimpleSession createSimpleSession(final String userName, final List<String> roles) {
-        return new SimpleSession(userName, roles.toArray(new String[roles.size()]));
-    }
-
-    // //////////////////////////////////////////////////////////////////
-    // API
-    // //////////////////////////////////////////////////////////////////
-
-    /**
-     * Can authenticate if a {@link AuthenticationRequestExploration}.
-     */
-    @Override
-    public final boolean canAuthenticate(final Class<? extends AuthenticationRequest> authenticationRequestClass) {
-        return AuthenticationRequestExploration.class.isAssignableFrom(authenticationRequestClass);
-    }
-
-    /**
-     * Valid providing running in {@link DeploymentType#isExploring() 
-     * exploration} mode.
-     */
-    @Override
-    protected final boolean isValid(final AuthenticationRequest request) {
-        return getDeploymentType().isExploring();
-    }
-
-    @Override
-    public AuthenticationSession authenticate(final AuthenticationRequest request, final String code) {
-        final AuthenticationRequestExploration authenticationRequestExploration = (AuthenticationRequestExploration) request;
-        if (!authenticationRequestExploration.isDefaultUser()) {
-            registeredSessions.add(createSimpleSession(authenticationRequestExploration.getName(), authenticationRequestExploration.getRoles()));
-        }
-        if (registeredSessions.size() >= 1) {
-            return registeredSessions.iterator().next();
-        } else {
-            return new ExplorationSession(code);
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationAuthenticatorConstants.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationAuthenticatorConstants.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationAuthenticatorConstants.java
deleted file mode 100644
index 36c2c16..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationAuthenticatorConstants.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.runtime.authentication.exploration;
-
-import org.apache.isis.core.commons.config.ConfigurationConstants;
-
-public final class ExplorationAuthenticatorConstants {
-
-    public static final String USERS = ConfigurationConstants.ROOT + "exploration.users";
-
-    private ExplorationAuthenticatorConstants() {
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationSession.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationSession.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationSession.java
deleted file mode 100644
index 144a2b2..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/exploration/ExplorationSession.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.runtime.authentication.exploration;
-
-import java.io.IOException;
-
-import org.apache.isis.core.commons.authentication.AuthenticationSessionAbstract;
-import org.apache.isis.core.commons.encoding.DataInputExtended;
-import org.apache.isis.core.commons.encoding.DataOutputExtended;
-import org.apache.isis.core.commons.encoding.Encodable;
-
-public final class ExplorationSession extends AuthenticationSessionAbstract implements Encodable {
-
-    private static final long serialVersionUID = 1L;
-
-    private static final String DEFAULT_USER_NAME = "exploration";
-
-    /**
-     * Defaults validation code to <tt>""</tt>.
-     */
-    public ExplorationSession() {
-        this("");
-    }
-
-    public ExplorationSession(final String code) {
-        super(DEFAULT_USER_NAME, code);
-        initialized();
-    }
-
-    public ExplorationSession(final DataInputExtended input) throws IOException {
-        super(input);
-        initialized();
-    }
-
-    @Override
-    public void encode(final DataOutputExtended output) throws IOException {
-        super.encode(output);
-    }
-
-    private void initialized() {
-        // nothing to do
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/fixture/LogonFixtureAuthenticator.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/fixture/LogonFixtureAuthenticator.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/fixture/LogonFixtureAuthenticator.java
deleted file mode 100644
index 9889bce..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/authentication/fixture/LogonFixtureAuthenticator.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.runtime.authentication.fixture;
-
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
-import org.apache.isis.core.runtime.authentication.AuthenticatorAbstractForDfltRuntime;
-import org.apache.isis.core.runtime.authentication.standard.Authenticator;
-import org.apache.isis.core.runtime.fixtures.authentication.AuthenticationRequestLogonFixture;
-import org.apache.isis.core.runtime.system.DeploymentType;
-
-public class LogonFixtureAuthenticator extends AuthenticatorAbstractForDfltRuntime {
-
-    public LogonFixtureAuthenticator(final IsisConfiguration configuration) {
-        super(configuration);
-    }
-
-    /**
-     * Can authenticate if a {@link AuthenticationRequestLogonFixture}.
-     */
-    @Override
-    public final boolean canAuthenticate(final Class<? extends AuthenticationRequest> authenticationRequestClass) {
-        return AuthenticationRequestLogonFixture.class.isAssignableFrom(authenticationRequestClass);
-    }
-
-    /**
-     * Valid providing running in {@link DeploymentType#isExploring()
-     * exploration} or {@link DeploymentType#isPrototyping() prototyping} mode.
-     */
-    @Override
-    protected final boolean isValid(final AuthenticationRequest request) {
-        final DeploymentType deploymentType = getDeploymentType();
-        return deploymentType.isExploring() || deploymentType.isPrototyping();
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/runtime/src/main/java/org/apache/isis/core/runtime/fixtures/authentication/AuthenticationRequestLogonFixture.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/fixtures/authentication/AuthenticationRequestLogonFixture.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/fixtures/authentication/AuthenticationRequestLogonFixture.java
deleted file mode 100644
index c3f52cc..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/fixtures/authentication/AuthenticationRequestLogonFixture.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.runtime.fixtures.authentication;
-
-import java.util.List;
-
-import org.apache.isis.applib.fixtures.LogonFixture;
-import org.apache.isis.core.runtime.authentication.AuthenticationRequestAbstract;
-import org.apache.isis.core.runtime.authentication.standard.AuthenticationManagerStandard;
-
-/**
- * For testing purposes, request corresponding to a {@link LogonFixture}.
- * 
- * <p>
- * Understood directly by {@link AuthenticationManagerStandard}.
- */
-public class AuthenticationRequestLogonFixture extends AuthenticationRequestAbstract {
-
-    public AuthenticationRequestLogonFixture(final LogonFixture logonFixture) {
-        this(logonFixture.getUsername(), logonFixture.getRoles());
-    }
-
-    public AuthenticationRequestLogonFixture(final String name, final List<String> roles) {
-        super(name);
-        setRoles(roles);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java
index 3bcdcdf..b675988 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java
@@ -178,8 +178,8 @@ public class IsisSessionFactoryBuilder {
 
 
                 // remaining functionality only done if metamodel is valid.
-                authenticationManager.init();
-                authorizationManager.init();
+                authenticationManager.init(deploymentCategory);
+                authorizationManager.init(deploymentCategory);
 
                 persistenceSessionFactory.init(specificationLoader);
 

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/runtime/src/test/java/org/apache/isis/core/runtime/authentication/standard/AuthenticatorAbstractForDfltRuntimeTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/isis/core/runtime/authentication/standard/AuthenticatorAbstractForDfltRuntimeTest.java b/core/runtime/src/test/java/org/apache/isis/core/runtime/authentication/standard/AuthenticatorAbstractForDfltRuntimeTest.java
deleted file mode 100644
index aed6454..0000000
--- a/core/runtime/src/test/java/org/apache/isis/core/runtime/authentication/standard/AuthenticatorAbstractForDfltRuntimeTest.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.runtime.authentication.standard;
-
-import org.jmock.Expectations;
-import org.jmock.Mockery;
-import org.jmock.integration.junit4.JMock;
-import org.jmock.integration.junit4.JUnit4Mockery;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
-import org.apache.isis.core.runtime.authentication.AuthenticatorAbstractForDfltRuntime;
-import org.apache.isis.core.runtime.system.DeploymentType;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-@RunWith(JMock.class)
-public class AuthenticatorAbstractForDfltRuntimeTest {
-
-    private final Mockery mockery = new JUnit4Mockery();
-
-    private IsisConfiguration mockConfiguration;
-    private AuthenticatorAbstractForDfltRuntime authenticator;
-
-    @Before
-    public void setUp() {
-        mockConfiguration = mockery.mock(IsisConfiguration.class);
-
-        authenticator = new AuthenticatorAbstractForDfltRuntime(mockConfiguration) {
-
-            @Override
-            public boolean isValid(final AuthenticationRequest request) {
-                return false;
-            }
-
-            @Override
-            public boolean canAuthenticate(final Class<? extends AuthenticationRequest> authenticationRequestClass) {
-                return false;
-            }
-        };
-    }
-
-    @Test
-    public void getConfiguration() throws Exception {
-        assertThat(authenticator.getConfiguration(), is(mockConfiguration));
-    }
-
-    @Test
-    public void getDeploymentTypeForExploration() throws Exception {
-        final DeploymentType deploymentType = DeploymentType.SERVER_EXPLORATION;
-        mockery.checking(new Expectations() {
-            {
-                allowing(mockConfiguration).getString("isis.deploymentType");
-                will(returnValue(deploymentType.name()));
-            }
-        });
-        assertThat(authenticator.getDeploymentType(), is(deploymentType));
-    }
-
-    @Test
-    public void getDeploymentTypeForPrototype() throws Exception {
-        final DeploymentType deploymentType = DeploymentType.SERVER_PROTOTYPE;
-        mockery.checking(new Expectations() {
-            {
-                allowing(mockConfiguration).getString("isis.deploymentType");
-                will(returnValue(deploymentType.name()));
-            }
-        });
-        assertThat(authenticator.getDeploymentType(), is(deploymentType));
-    }
-
-    @Test
-    public void getDeploymentTypeForServer() throws Exception {
-        final DeploymentType deploymentType = DeploymentType.SERVER;
-        mockery.checking(new Expectations() {
-            {
-                allowing(mockConfiguration).getString("isis.deploymentType");
-                will(returnValue(deploymentType.name()));
-            }
-        });
-        assertThat(authenticator.getDeploymentType(), is(deploymentType));
-    }
-
-    @Test(expected = IllegalStateException.class)
-    public void expectsThereToBeADeploymentTypeInIsisConfiguration() throws Exception {
-        mockery.checking(new Expectations() {
-            {
-                allowing(mockConfiguration).getString("isis.deploymentType");
-                will(returnValue(null));
-            }
-        });
-        authenticator.getDeploymentType();
-    }
-
-    @Test(expected = IllegalArgumentException.class)
-    public void expectsThereToBeAValidDeploymentTypeInIsisConfiguration() throws Exception {
-        mockery.checking(new Expectations() {
-            {
-                allowing(mockConfiguration).getString("isis.deploymentType");
-                will(returnValue("GARBAGE"));
-            }
-        });
-        authenticator.getDeploymentType();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/runtime/src/test/java/org/apache/isis/core/runtime/authentication/standard/AuthenticatorDefaultTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/isis/core/runtime/authentication/standard/AuthenticatorDefaultTest.java b/core/runtime/src/test/java/org/apache/isis/core/runtime/authentication/standard/AuthenticatorDefaultTest.java
new file mode 100644
index 0000000..4f5b2ac
--- /dev/null
+++ b/core/runtime/src/test/java/org/apache/isis/core/runtime/authentication/standard/AuthenticatorDefaultTest.java
@@ -0,0 +1,76 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.runtime.authentication.standard;
+
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JMock;
+import org.jmock.integration.junit4.JUnit4Mockery;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
+import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
+import org.apache.isis.core.runtime.system.DeploymentType;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+@RunWith(JMock.class)
+public class AuthenticatorDefaultTest {
+
+    private final Mockery mockery = new JUnit4Mockery();
+
+    private IsisConfiguration mockConfiguration;
+    private AuthenticatorAbstract authenticator;
+
+    @Before
+    public void setUp() {
+        mockConfiguration = mockery.mock(IsisConfiguration.class);
+
+        authenticator = new AuthenticatorAbstract(mockConfiguration) {
+
+            @Override
+            public boolean isValid(final AuthenticationRequest request) {
+                return false;
+            }
+
+            @Override
+            public boolean canAuthenticate(final Class<? extends AuthenticationRequest> authenticationRequestClass) {
+                return false;
+            }
+        };
+    }
+
+    @Test
+    public void getConfiguration() throws Exception {
+        assertThat(authenticator.getConfiguration(), is(mockConfiguration));
+    }
+
+    @Test
+    public void getDeploymentCategory() throws Exception {
+        final DeploymentCategory deploymentCategory = DeploymentType.SERVER_EXPLORATION.getDeploymentCategory();
+        authenticator.init(deploymentCategory);
+        assertThat(authenticator.getDeploymentCategory(), is(deploymentCategory));
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/security-shiro/src/main/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizor.java
----------------------------------------------------------------------
diff --git a/core/security-shiro/src/main/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizor.java b/core/security-shiro/src/main/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizor.java
index 6896d63..68ab0e4 100644
--- a/core/security-shiro/src/main/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizor.java
+++ b/core/security-shiro/src/main/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizor.java
@@ -45,6 +45,7 @@ import org.slf4j.LoggerFactory;
 import org.apache.isis.applib.Identifier;
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
 import org.apache.isis.core.runtime.authentication.AuthenticationManagerInstaller;
 import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
 import org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword;
@@ -69,6 +70,7 @@ public class ShiroAuthenticatorOrAuthorizor implements Authenticator, Authorizor
 
     //region > constructor and fields
     private final IsisConfiguration configuration;
+    private DeploymentCategory deploymentCategory;
 
     public ShiroAuthenticatorOrAuthorizor(final IsisConfiguration configuration) {
         this.configuration = configuration;
@@ -83,13 +85,20 @@ public class ShiroAuthenticatorOrAuthorizor implements Authenticator, Authorizor
     //region > init, shutdown
 
     @Override
-    public void init() {
+    public void init(final DeploymentCategory deploymentCategory) {
+        this.deploymentCategory = deploymentCategory;
     }
 
 
     @Override
     public void shutdown() {
     }
+
+    @Override
+    public DeploymentCategory getDeploymentCategory() {
+        return deploymentCategory;
+    }
+
     //endregion
 
     //region > Authenticator API

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/security-shiro/src/test/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizorTest_authenticate.java
----------------------------------------------------------------------
diff --git a/core/security-shiro/src/test/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizorTest_authenticate.java b/core/security-shiro/src/test/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizorTest_authenticate.java
index 00d6d28..722b2a7 100644
--- a/core/security-shiro/src/test/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizorTest_authenticate.java
+++ b/core/security-shiro/src/test/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizorTest_authenticate.java
@@ -18,18 +18,6 @@
  */
 package org.apache.isis.security.shiro;
 
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-import org.apache.isis.applib.Identifier;
-import org.apache.isis.core.commons.authentication.AuthenticationSession;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
-import org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
 import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.config.IniSecurityManagerFactory;
 import org.apache.shiro.mgt.SecurityManager;
@@ -41,6 +29,20 @@ import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 
+import org.apache.isis.applib.Identifier;
+import org.apache.isis.core.commons.authentication.AuthenticationSession;
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
+import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
+import org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
 public class ShiroAuthenticatorOrAuthorizorTest_authenticate {
 
     @Rule
@@ -54,7 +56,7 @@ public class ShiroAuthenticatorOrAuthorizorTest_authenticate {
     @Before
     public void setUp() throws Exception {
         authOrAuth = new ShiroAuthenticatorOrAuthorizor(mockConfiguration);
-        authOrAuth.init();
+        authOrAuth.init(DeploymentCategory.PRODUCTION);
     }
 
     @After

http://git-wip-us.apache.org/repos/asf/isis/blob/364e5b9b/core/security-shiro/src/test/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizorTest_isVisibleInAnyRole.java
----------------------------------------------------------------------
diff --git a/core/security-shiro/src/test/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizorTest_isVisibleInAnyRole.java b/core/security-shiro/src/test/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizorTest_isVisibleInAnyRole.java
index 37035f4..ae8d414 100644
--- a/core/security-shiro/src/test/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizorTest_isVisibleInAnyRole.java
+++ b/core/security-shiro/src/test/java/org/apache/isis/security/shiro/ShiroAuthenticatorOrAuthorizorTest_isVisibleInAnyRole.java
@@ -18,15 +18,6 @@
  */
 package org.apache.isis.security.shiro;
 
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import org.apache.isis.applib.Identifier;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
-import org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
 import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.config.IniSecurityManagerFactory;
 import org.apache.shiro.mgt.SecurityManager;
@@ -38,6 +29,17 @@ import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 
+import org.apache.isis.applib.Identifier;
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
+import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
+import org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
 public class ShiroAuthenticatorOrAuthorizorTest_isVisibleInAnyRole {
 
     @Rule
@@ -51,7 +53,7 @@ public class ShiroAuthenticatorOrAuthorizorTest_isVisibleInAnyRole {
     @Before
     public void setUp() throws Exception {
         authOrAuth = new ShiroAuthenticatorOrAuthorizor(mockConfiguration);
-        authOrAuth.init();
+        authOrAuth.init(DeploymentCategory.PRODUCTION);
     }
 
     @After