|
25 | 25 |
|
26 | 26 | public interface SAML2AuthManager extends PluggableAPIAuthenticator, PluggableService { |
27 | 27 |
|
28 | | - public static final ConfigKey<Boolean> SAMLIsPluginEnabled = new ConfigKey<Boolean>("Advanced", Boolean.class, "saml2.enabled", "false", |
| 28 | + ConfigKey<Boolean> SAMLIsPluginEnabled = new ConfigKey<Boolean>("Advanced", Boolean.class, "saml2.enabled", "false", |
29 | 29 | "Indicates whether SAML SSO plugin is enabled or not", true); |
30 | 30 |
|
31 | | - public static final ConfigKey<String> SAMLServiceProviderID = new ConfigKey<String>("Advanced", String.class, "saml2.sp.id", "org.apache.cloudstack", |
| 31 | + ConfigKey<String> SAMLServiceProviderID = new ConfigKey<String>("Advanced", String.class, "saml2.sp.id", "org.apache.cloudstack", |
32 | 32 | "SAML2 Service Provider Identifier String", true); |
33 | 33 |
|
34 | | - public static final ConfigKey<String> SAMLServiceProviderContactPersonName = new ConfigKey<String>("Advanced", String.class, "saml2.sp.contact.person", "CloudStack Developers", |
| 34 | + ConfigKey<String> SAMLServiceProviderContactPersonName = new ConfigKey<String>("Advanced", String.class, "saml2.sp.contact.person", "CloudStack Developers", |
35 | 35 | "SAML2 Service Provider Contact Person Name", true); |
36 | 36 |
|
37 | | - public static final ConfigKey< String> SAMLServiceProviderContactEmail = new ConfigKey< String>( "Advanced", String. class, "saml2.sp.contact.email", "[email protected]", |
| 37 | + ConfigKey< String> SAMLServiceProviderContactEmail = new ConfigKey< String>( "Advanced", String. class, "saml2.sp.contact.email", "[email protected]", |
38 | 38 | "SAML2 Service Provider Contact Email Address", true); |
39 | 39 |
|
40 | | - public static final ConfigKey<String> SAMLServiceProviderOrgName = new ConfigKey<String>("Advanced", String.class, "saml2.sp.org.name", "Apache CloudStack", |
| 40 | + ConfigKey<String> SAMLServiceProviderOrgName = new ConfigKey<String>("Advanced", String.class, "saml2.sp.org.name", "Apache CloudStack", |
41 | 41 | "SAML2 Service Provider Organization Name", true); |
42 | 42 |
|
43 | | - public static final ConfigKey<String> SAMLServiceProviderOrgUrl = new ConfigKey<String>("Advanced", String.class, "saml2.sp.org.url", "http://cloudstack.apache.org", |
| 43 | + ConfigKey<String> SAMLServiceProviderOrgUrl = new ConfigKey<String>("Advanced", String.class, "saml2.sp.org.url", "http://cloudstack.apache.org", |
44 | 44 | "SAML2 Service Provider Organization URL", true); |
45 | 45 |
|
46 | | - public static final ConfigKey<String> SAMLServiceProviderSingleSignOnURL = new ConfigKey<String>("Advanced", String.class, "saml2.sp.sso.url", "http://localhost:8080/client/api?command=samlSso", |
| 46 | + ConfigKey<String> SAMLServiceProviderSingleSignOnURL = new ConfigKey<String>("Advanced", String.class, "saml2.sp.sso.url", "http://localhost:8080/client/api?command=samlSso", |
47 | 47 | "SAML2 CloudStack Service Provider Single Sign On URL", true); |
48 | 48 |
|
49 | | - public static final ConfigKey<String> SAMLServiceProviderSingleLogOutURL = new ConfigKey<String>("Advanced", String.class, "saml2.sp.slo.url", "http://localhost:8080/client/", |
| 49 | + ConfigKey<String> SAMLServiceProviderSingleLogOutURL = new ConfigKey<String>("Advanced", String.class, "saml2.sp.slo.url", "http://localhost:8080/client/", |
50 | 50 | "SAML2 CloudStack Service Provider Single Log Out URL", true); |
51 | 51 |
|
52 | | - public static final ConfigKey<String> SAMLCloudStackRedirectionUrl = new ConfigKey<String>("Advanced", String.class, "saml2.redirect.url", "http://localhost:8080/client", |
| 52 | + ConfigKey<String> SAMLCloudStackRedirectionUrl = new ConfigKey<String>("Advanced", String.class, "saml2.redirect.url", "http://localhost:8080/client", |
53 | 53 | "The CloudStack UI url the SSO should redirected to when successful", true); |
54 | 54 |
|
55 | | - public static final ConfigKey<String> SAMLUserAttributeName = new ConfigKey<String>("Advanced", String.class, "saml2.user.attribute", "uid", |
| 55 | + ConfigKey<String> SAMLUserAttributeName = new ConfigKey<String>("Advanced", String.class, "saml2.user.attribute", "uid", |
56 | 56 | "Attribute name to be looked for in SAML response that will contain the username", true); |
57 | 57 |
|
58 | | - public static final ConfigKey<String> SAMLIdentityProviderMetadataURL = new ConfigKey<String>("Advanced", String.class, "saml2.idp.metadata.url", "https://openidp.feide.no/simplesaml/saml2/idp/metadata.php", |
| 58 | + ConfigKey<String> SAMLIdentityProviderMetadataURL = new ConfigKey<String>("Advanced", String.class, "saml2.idp.metadata.url", "https://openidp.feide.no/simplesaml/saml2/idp/metadata.php", |
59 | 59 | "SAML2 Identity Provider Metadata XML Url", true); |
60 | 60 |
|
61 | | - public static final ConfigKey<String> SAMLDefaultIdentityProviderId = new ConfigKey<String>("Advanced", String.class, "saml2.default.idpid", "https://openidp.feide.no", |
| 61 | + ConfigKey<String> SAMLDefaultIdentityProviderId = new ConfigKey<String>("Advanced", String.class, "saml2.default.idpid", "https://openidp.feide.no", |
62 | 62 | "The default IdP entity ID to use only in case of multiple IdPs", true); |
63 | 63 |
|
64 | | - public static final ConfigKey<String> SAMLSignatureAlgorithm = new ConfigKey<>(String.class, "saml2.sigalg", "Advanced", "SHA1", |
| 64 | + ConfigKey<String> SAMLSignatureAlgorithm = new ConfigKey<>(String.class, "saml2.sigalg", "Advanced", "SHA1", |
65 | 65 | "The algorithm to use to when signing a SAML request. Default is SHA1, allowed algorithms: SHA1, SHA256, SHA384, SHA512", true, ConfigKey.Scope.Global, null, null, null, null, null, ConfigKey.Kind.Select, "SHA1,SHA256,SHA384,SHA512"); |
66 | 66 |
|
67 | | - public static final ConfigKey<Boolean> SAMLAppendDomainSuffix = new ConfigKey<Boolean>("Advanced", Boolean.class, "saml2.append.idpdomain", "false", |
| 67 | + ConfigKey<Boolean> SAMLAppendDomainSuffix = new ConfigKey<Boolean>("Advanced", Boolean.class, "saml2.append.idpdomain", "false", |
68 | 68 | "If enabled, create account/user dialog with SAML SSO enabled will append the IdP domain to the user or account name in the UI dialog", true); |
69 | 69 |
|
70 | | - public static final ConfigKey<Integer> SAMLTimeout = new ConfigKey<Integer>("Advanced", Integer.class, "saml2.timeout", "1800", |
| 70 | + ConfigKey<Integer> SAMLTimeout = new ConfigKey<Integer>("Advanced", Integer.class, "saml2.timeout", "1800", |
71 | 71 | "SAML2 IDP Metadata refresh interval in seconds, minimum value is set to 300", true); |
72 | 72 |
|
73 | | - public SAMLProviderMetadata getSPMetadata(); |
74 | | - public SAMLProviderMetadata getIdPMetadata(String entityId); |
75 | | - public Collection<SAMLProviderMetadata> getAllIdPMetadata(); |
| 73 | + ConfigKey<Boolean> SAMLCheckSignature = new ConfigKey<Boolean>("Advanced", Boolean.class, "saml2.check.signature", "true", |
| 74 | + "When enabled (default and recommended), SAML2 signature checks are enforced and lack of signature in the SAML SSO response will cause login exception. Disabling this is not advisable but provided for backward compatibility for users who are able to accept the risks.", false); |
76 | 75 |
|
77 | | - public boolean isUserAuthorized(Long userId, String entityId); |
78 | | - public boolean authorizeUser(Long userId, String entityId, boolean enable); |
| 76 | + SAMLProviderMetadata getSPMetadata(); |
| 77 | + SAMLProviderMetadata getIdPMetadata(String entityId); |
| 78 | + Collection<SAMLProviderMetadata> getAllIdPMetadata(); |
79 | 79 |
|
80 | | - public void saveToken(String authnId, String domain, String entity); |
81 | | - public SAMLTokenVO getToken(String authnId); |
82 | | - public void expireTokens(); |
| 80 | + boolean isUserAuthorized(Long userId, String entityId); |
| 81 | + boolean authorizeUser(Long userId, String entityId, boolean enable); |
| 82 | + |
| 83 | + void saveToken(String authnId, String domain, String entity); |
| 84 | + SAMLTokenVO getToken(String authnId); |
| 85 | + void purgeToken(SAMLTokenVO token); |
| 86 | + void expireTokens(); |
83 | 87 | } |
0 commit comments