From 4422fdd9ad359f29848de304b92b5fd3b214cb28 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Sun, 24 Aug 2014 15:56:10 +0200 Subject: [PATCH] saml2: Implement SAML2AuthServiceImpl which is a PluggableAPIAuthenticator Signed-off-by: Rohit Yadav --- .../cloudstack/saml/SAML2AuthServiceImpl.java | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 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 00000000000..44e29ca7ac6 --- /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> getAuthCommands() { + List> cmdList = new ArrayList>(); + cmdList.add(SAML2LoginAPIAuthenticatorCmd.class); + cmdList.add(SAML2LogoutAPIAuthenticatorCmd.class); + return cmdList; + } +}