saml2: Implement SAML2AuthServiceImpl which is a PluggableAPIAuthenticator

Signed-off-by: Rohit Yadav <rohit.ya...@shapeblue.com>


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

Branch: refs/heads/saml2
Commit: cc1484371d9358838a51af9a34018d422fb490c0
Parents: 31616e6
Author: Rohit Yadav <rohit.ya...@shapeblue.com>
Authored: Sun Aug 24 15:56:10 2014 +0200
Committer: Rohit Yadav <rohit.ya...@shapeblue.com>
Committed: Sun Aug 24 15:56:10 2014 +0200

----------------------------------------------------------------------
 .../cloudstack/saml/SAML2AuthServiceImpl.java   | 51 ++++++++++++++++++++
 1 file changed, 51 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cc148437/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2AuthServiceImpl.java
----------------------------------------------------------------------
diff --git 
a/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2AuthServiceImpl.java
 
b/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2AuthServiceImpl.java
new file mode 100644
index 0000000..44e29ca
--- /dev/null
+++ 
b/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2AuthServiceImpl.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.cloudstack.saml;
+
+import com.cloud.utils.component.AdapterBase;
+import org.apache.cloudstack.api.auth.PluggableAPIAuthenticator;
+import org.apache.cloudstack.api.command.SAML2LoginAPIAuthenticatorCmd;
+import org.apache.cloudstack.api.command.SAML2LogoutAPIAuthenticatorCmd;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+import javax.ejb.Local;
+import java.util.ArrayList;
+import java.util.List;
+
+@Component
+@Local(value = PluggableAPIAuthenticator.class)
+public class SAML2AuthServiceImpl extends AdapterBase implements 
PluggableAPIAuthenticator {
+    private static final Logger s_logger = 
Logger.getLogger(SAML2AuthServiceImpl.class);
+
+    protected SAML2AuthServiceImpl() {
+        super();
+    }
+
+    @Override
+    public boolean start() {
+        return true;
+    }
+
+    @Override
+    public List<Class<?>> getAuthCommands() {
+        List<Class<?>> cmdList = new ArrayList<Class<?>>();
+        cmdList.add(SAML2LoginAPIAuthenticatorCmd.class);
+        cmdList.add(SAML2LogoutAPIAuthenticatorCmd.class);
+        return cmdList;
+    }
+}

Reply via email to