Skip to content

Commit 4422fdd

Browse files
committed
saml2: Implement SAML2AuthServiceImpl which is a PluggableAPIAuthenticator
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 47c9050 commit 4422fdd

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package org.apache.cloudstack.saml;
18+
19+
import com.cloud.utils.component.AdapterBase;
20+
import org.apache.cloudstack.api.auth.PluggableAPIAuthenticator;
21+
import org.apache.cloudstack.api.command.SAML2LoginAPIAuthenticatorCmd;
22+
import org.apache.cloudstack.api.command.SAML2LogoutAPIAuthenticatorCmd;
23+
import org.apache.log4j.Logger;
24+
import org.springframework.stereotype.Component;
25+
26+
import javax.ejb.Local;
27+
import java.util.ArrayList;
28+
import java.util.List;
29+
30+
@Component
31+
@Local(value = PluggableAPIAuthenticator.class)
32+
public class SAML2AuthServiceImpl extends AdapterBase implements PluggableAPIAuthenticator {
33+
private static final Logger s_logger = Logger.getLogger(SAML2AuthServiceImpl.class);
34+
35+
protected SAML2AuthServiceImpl() {
36+
super();
37+
}
38+
39+
@Override
40+
public boolean start() {
41+
return true;
42+
}
43+
44+
@Override
45+
public List<Class<?>> getAuthCommands() {
46+
List<Class<?>> cmdList = new ArrayList<Class<?>>();
47+
cmdList.add(SAML2LoginAPIAuthenticatorCmd.class);
48+
cmdList.add(SAML2LogoutAPIAuthenticatorCmd.class);
49+
return cmdList;
50+
}
51+
}

0 commit comments

Comments
 (0)